/* Authentication Pages Styles */

.auth-section {
    padding: 24px 0;
    min-height: calc(100vh - 140px);
    background: linear-gradient(135deg, var(--bg-lighter) 0%, var(--bg-white) 100%);
}

/* Prevent page-level scroll when auth shows */
body.auth-no-scroll {
    overflow: hidden
}

/* ----------------------------
   Standalone one-page auth
   When `body` has class `auth-page` we force a full-viewport
   layout and prevent the overall page from vertically scrolling.
   The right column (`.auth-card`) becomes internally scrollable
   if content overflows the viewport so the browser page stays
   fixed to one screen height.
   ---------------------------- */
body.auth-page, html, body {
    height: 100%;
}

body.auth-page {
    overflow: hidden; /* prevent page-level vertical scroll */
    background: var(--bg-light);
}

body.auth-page .auth-section {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: stretch;
    padding: 0; /* page-level padding handled inside container */
}

body.auth-page .auth-container {
    height: 90vh;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 520px; /* slightly wider form column on large screens */
    align-items: stretch;
    overflow: hidden; /* ensure rounded corners clip internal scrollbars */
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* make inner panels fill the container rather than the viewport
   so internal scrolling remains inside the rounded auth container */
body.auth-page .auth-image,
body.auth-page .auth-card {
    height: 100%;
}

/* Keep left panel static and centered */
body.auth-page .auth-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
    box-sizing: border-box;
}

/* Right column scrolls internally if needed */
body.auth-page .auth-card {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 36px 40px;
}

/* Hide native scrollbars but keep scrolling functional */
body.auth-page .auth-card {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}
body.auth-page .auth-card::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Reduce large button height used earlier when used inside full page */
body.auth-page .auth-btn { height: 48px; }

/* Slightly reduce guideline size to help fit more content */
body.auth-page .password-guidelines { font-size: 13px; padding: 10px; }

/* Reduce margins on form rows so the layout fits better on smaller viewports */
body.auth-page .form-group { margin-bottom: 10px; }


.auth-container {
    display: grid;
    grid-template-columns: 1fr 470px;
    gap: 0;
    /* make the split seamless */
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Auth Card */
.auth-card {
    background: transparent;
    padding: 28px 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-left: 1px solid rgba(0, 0, 0, 0.04);
}

.auth-image {
    height: 100%;
}

.auth-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px
}

.tab-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    font-weight: 700
}

.tab-btn.active {
    background: var(--bg-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06)
}

.tab {
    display: block
}

.auth-header {
    text-align: center;
    margin-bottom: 18px
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-dark);
    opacity: 0.7;
    font-size: 16px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;

    .auth-card {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
    }

    font-size: 14px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert i {
    font-size: 18px;
}

/* Form Styles */
.auth-form {
    margin-bottom: 18px
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.form-group {
    margin-bottom: 12px
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background-color: var(--bg-white);
    color: var(--text-dark);
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background-color: var(--bg-white);
    color: var(--text-dark);
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-lightest);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-lightest);
}

.form-group input::placeholder {
    color: var(--text-dark);
    opacity: 0.5;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 70%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dark);
    opacity: 0.6;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: opacity 0.3s;
}

.toggle-password:hover {
    opacity: 1;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-dark);
    opacity: 0.6;
}

.password-guidelines {
    background: #f7f7f7;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    padding: 12px;
    margin-top: 10px
}

.password-guidelines ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-dark)
}

.password-guidelines li {
    margin-bottom: 6px
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
}

.remember-me input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.5;
}

.terms-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    cursor: pointer;
}

.terms-checkbox a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

/* Auth Button */
.auth-btn {
    width: 100%;
    height: 40px;
    /* account for header/footer */
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    margin-bottom: 20px;
    margin-top: 20px;
}

.auth-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 91, 89, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

/* Divider */
.auth-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
}

.auth-divider span {
    background: var(--bg-white);
    padding: 0 15px;
    color: var(--text-dark);
    opacity: 0.6;
    position: relative;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 25px;
}

.social-btn {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background-color: var(--bg-white);
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.social-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.social-btn i {
    font-size: 18px;
}

.google-btn:hover {
    background-color: #f8f9fa;
}

.facebook-btn:hover {
    background-color: #f8f9fa;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-lighter);
}

.auth-footer p {
    color: var(--text-dark);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Auth Image */
.auth-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--text-light);
    padding: 48px 36px;
}

.auth-image-content {
    text-align: center;
}

.auth-image-content h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-light);
}

.auth-image-sub {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.95;
    color: var(--text-light)
}

.back-to-home {
    position: absolute;
    left: 24px;
    top: 24px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-light);
    padding: 8px 14px;
    border-radius: 26px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s
}

.back-to-home:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px)
}

.auth-image {
    position: relative
}

.hero-logo {
    font-size: 44px;
    font-weight: 900;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;    
}

.hero-logo-img {
    height: 280px;
    width: auto;
}

/* Button styles (gradient) */
.auth-btn {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: 0;
    color: #fff
}

.auth-btn:hover {
    box-shadow: 0 8px 18px rgba(2, 91, 89, 0.25)
}

/* Google / Facebook buttons more distinct */
.google-btn {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    color: var(--text-dark)
}

.facebook-btn {
    background: #fff;
    border: 1px dashed var(--border-light);
    color: var(--text-dark)
}

.social-login .social-btn {
    box-shadow: none
}

.social-btn i {
    margin-right: 10px
}

.auth-image-content p {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.auth-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.feature-item i {
    font-size: 32px;
    margin-bottom: 5px;
}

.feature-item span {
    font-size: 14px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 992px) {
    .auth-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .auth-image {
        order: -1;
        padding: 30px;
    }

    /* Ensure full vertical stacking and allow the form to scroll into view
       (fixes issue where red panel clips form off-screen on small devices) */
    .auth-container,
    body.auth-page .auth-container {
        grid-template-columns: 1fr !important;
        height: auto !important;
        overflow: visible !important;
    }

    body.auth-page .auth-container {
        display: block;
        padding: 0 12px;
    }

    .auth-image,
    .auth-card {
        width: 100%;
        min-height: auto;
        height: auto;
    }

    .auth-card {
        border-left: none;
        box-shadow: none;
        padding: 22px 18px;
    }

    .auth-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
    }

    .auth-header h1 {
        font-size: 28px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-image-content h2 {
        font-size: 28px;
    }

    .auth-features {
        grid-template-columns: 1fr;
    }

    /* Additional mobile-friendly tweaks */
    .auth-image {
        padding: 20px;
    }

    .hero-logo-img {
        height: auto;
        max-width: 160px;
        margin-bottom: 10px;
    }

    .auth-image-content p {
        font-size: 15px;
    }

    .social-login {
        flex-direction: column;
        gap: 10px;
    }

    .social-btn {
        width: 100%;
    }

    .toggle-password {
        right: 10px;
        top: 70%;
        transform: translateY(-70%);
    }

    .auth-btn {
        height: 46px;
    }

    .back-to-home {
        left: 12px;
        top: 12px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .auth-container {
        border-radius: 12px;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .auth-image-content h2 {
        font-size: 22px;
    }

    .hero-logo-img {
        max-width: 140px;
    }

    .auth-image {
        padding: 16px;
    }

    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 14px;
    }

    .password-guidelines {
        font-size: 12px;
        padding: 10px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 14px;
    }

    .auth-divider span {
        padding: 0 10px;
        font-size: 13px;
    }

    .remember-me,
    .forgot-password,
    .terms-checkbox {
        font-size: 13px;
    }
}

/* Tweak password toggle for small screens to center it and increase touch target */
@media (max-width: 768px) {
    .password-input-wrapper {
        position: relative;
        display: block;
    }

    .password-input-wrapper input {
        /* ensure there's room for the button inside the input */
        padding-right: 52px;
    }

    .toggle-password {
        position: absolute;
        right: 10px;
        top: 70%;
        transform: translateY(-50%);
        height: 36px;
        width: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: transparent;
        padding: 0;
        margin: 0;
        font-size: 16px;
        box-shadow: none;
        border: none;
        color: var(--text-dark);
        opacity: 0.9;
    }

    .toggle-password i {
        pointer-events: none;
    }
}

@media (max-width: 480px) {
    .password-input-wrapper input {
        padding-right: 48px;
    }

    .toggle-password {
        height: 32px;
        width: 32px;
        right: 8px;
        font-size: 15px;
    }
}

/* Ensure the auth page is scrollable on small devices
   Overrides full-viewport locking used for desktop standalone layout. */
@media (max-width: 992px) {
    html, body, body.auth-page {
        height: auto !important;
    }

    /* Allow natural page scrolling on mobile */
    body.auth-page {
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Make the auth section and container flow normally so content isn't clipped */
    body.auth-page .auth-section,
    body.auth-page .auth-container,
    .auth-container {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        display: block !important;
        padding: 0 12px !important;
    }

    /* Let the form column expand and be reachable by normal page scroll */
    body.auth-page .auth-card {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        padding-bottom: 30px;
    }

    /* Ensure image panel doesn't overlap or pin the layout */
    body.auth-page .auth-image {
        height: auto !important;
        min-height: 0 !important;
        padding-bottom: 18px !important;
    }
}

