body {
    font-family: Arial, sans-serif;
    background-color: #2a5a3a;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: auto;
    color: #fff;
}

.container {
    background-color: #1e4620;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    border: 2px solid #3a7d44;
    position: relative;
    overflow: visible;
}

.decorative-images {
    position: absolute;
    top: -114px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    padding: 0;
    z-index: 2;
}

.left-image,
.right-image {
    width: 143px;
    height: 114px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

h1 {
    text-align: center;
    color: #fff;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #3a7d44;
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #fff;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 0.75rem;
    background-color: #2a5a3a;
    border: 1px solid #3a7d44;
    border-radius: 8px;
    box-sizing: border-box;
    color: #fff;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: #4a8d54;
    box-shadow: 0 0 0 2px rgba(74, 141, 84, 0.2);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Checkbox styling */
.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #fff;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background-color: #2a5a3a;
    border: 2px solid #3a7d44;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #4a8d54;
    border-color: #4a8d54;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label:hover .checkmark {
    border-color: #4a8d54;
}

.tos-link {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
    margin-left: 0.25rem;
}

.tos-link:hover {
    color: #e0e0e0;
    text-decoration: underline;
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: #3a7d44;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 0.5rem;
    font-weight: bold;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

button:hover {
    background-color: #4a8d54;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.error {
    color: #fff;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: rgba(255, 107, 107, 0.15);
    border-radius: 6px;
    border: 2px solid #ff6b6b;
    font-weight: bold;
    font-size: 0.95rem;
    display: none;
    /* Hide by default */
}

.error:not(:empty) {
    display: block;
    /* Show only when there's content */
}

.register-link {
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: none;
}

.register-button {
    width: 100%;
    padding: 0.75rem;
    background-color: #3a7d44;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.register-button:hover {
    background-color: #4a8d54;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.register-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.forgot-password-link {
    text-align: center;
    margin-top: 0.5rem;
}

.forgot-password-link a {
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
}

.forgot-password-link a:hover {
    color: #e0e0e0;
    text-decoration: underline;
    transform: translateY(-1px);
}

.success {
    color: #fff;
    text-align: center;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: rgba(74, 141, 84, 0.3);
    border-radius: 4px;
    border: 1px solid #4a8d54;
    display: none;
}

.success:not(:empty) {
    display: block;
}

.back-to-login {
    text-align: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3a7d44;
}

.back-to-login a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.back-to-login a:hover {
    color: #e0e0e0;
    text-decoration: underline;
}

.switch-form {
    text-align: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3a7d44;
}

.switch-form a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.switch-form a:hover {
    color: #e0e0e0;
    text-decoration: none;
}

/* Tablet Responsive Styles */
@media screen and (max-width: 768px) and (min-width: 481px) {
    body {
        padding: 140px 1rem 40px 1rem; /* Better centering for tablets */
    }

    .container {
        margin: 0 auto;
    }

    .decorative-images {
        top: -110px;
    }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 480px) {
    body {
        padding: 120px 0 20px 0; /* Add top padding for decorative images */
        min-height: 100vh;
        min-height: -webkit-fill-available; /* Better mobile support */
    }

    .container {
        padding: 1.5rem;
        margin: 0 1rem;
        width: auto;
        /* Ensure container fits within viewport */
        max-width: calc(100vw - 2rem);
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    input {
        padding: 0.875rem;
        font-size: 16px; /* Prevent iOS zoom */
    }

    button,
    .register-button {
        padding: 0.875rem;
        font-size: 1rem;
    }

    .form-group {
        margin-bottom: 0.875rem;
    }

    .switch-form {
        margin-top: 0.875rem;
    }

    .decorative-images {
        width: 286px;
        top: -100px; /* Slightly reduced to prevent cutting off */
    }
    .left-image,
    .right-image {
        width: 143px;
        height: 114px;
    }
}

/* Ensure minimum touch target size */
@media (hover: none) and (pointer: coarse) {

    button,
    .register-button,
    input,
    .switch-form a {
        min-height: 44px;
    }
}

/* OAuth Section Styles */
.oauth-section {
    margin-top: 1rem;
    padding-top: 0;
    border-top: none;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0.75rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(74, 141, 84, 0.3);
}

.divider span {
    padding: 0 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Google Sign-In Button */
.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1f1f1f;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    margin-top: 0;
    font-family: Arial, sans-serif;
}

.google-signin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 141, 84, 0.05) 0%, rgba(58, 125, 68, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.google-signin-btn:hover {
    background-color: #f8f9fa;
    border-color: rgba(74, 141, 84, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(74, 141, 84, 0.15);
    transform: translateY(-2px);
}

.google-signin-btn:hover::before {
    opacity: 1;
}

.google-signin-btn:active {
    background-color: #f1f3f4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transform: translateY(0);
}

.google-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* Facebook Sign-In Button */
.facebook-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background-color: #1877F2;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    margin-top: 1rem;
    font-family: Arial, sans-serif;
}

.facebook-signin-btn:hover {
    background-color: #166FE5;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3), 0 4px 12px rgba(24, 119, 242, 0.2);
    transform: translateY(-2px);
}

.facebook-signin-btn:active {
    background-color: #1465D6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transform: translateY(0);
}

.facebook-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* Mobile adjustments for OAuth */
@media screen and (max-width: 480px) {
    .oauth-section {
        margin-top: 0.75rem;
    }

    .google-signin-btn,
    .facebook-signin-btn {
        font-size: 14px;
        padding: 10px 20px;
    }

    .google-icon,
    .facebook-icon {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }

    .divider span {
        font-size: 13px;
        padding: 0 12px;
    }

    .register-link {
        margin-top: 0.5rem;
    }

    .forgot-password-link {
        margin-top: 0.5rem;
    }
}

/* Ensure OAuth buttons meet touch target size */
@media (hover: none) and (pointer: coarse) {
    .google-signin-btn,
    .facebook-signin-btn {
        min-height: 44px;
    }
}

/* Very small screens - Extra adjustments */
@media screen and (max-height: 640px) {
    body {
        padding: 80px 0 20px 0; /* Reduce top padding on short screens */
    }

    .container {
        padding: 1rem;
    }

    .decorative-images {
        top: -90px; /* Move decorative images closer */
        width: 250px;
    }

    .left-image,
    .right-image {
        width: 120px;
        height: 96px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    input, button, .register-button {
        padding: 0.7rem;
    }
}

/* Landscape orientation on mobile */
@media screen and (max-width: 896px) and (max-height: 480px) and (orientation: landscape) {
    body {
        padding: 60px 1rem 20px 1rem;
        align-items: flex-start; /* Don't center vertically in landscape */
    }

    .container {
        margin: 0 auto;
    }

    .decorative-images {
        top: -80px;
        width: 220px;
    }

    .left-image,
    .right-image {
        width: 100px;
        height: 80px;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    input, button, .register-button {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .oauth-section {
        margin-top: 0.75rem;
    }

    .divider {
        margin: 0.5rem 0;
    }

    .register-link {
        margin-top: 0.5rem;
    }

    .forgot-password-link {
        margin-top: 0.5rem;
    }
}
