@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2f7 0%, #dfe9f5 100%);
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    padding: 24px;
}

.auth-back-link {
    position: absolute;
    top: 24px;
    left: 24px;
    color: #2b2f36;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: .75;
}

.auth-back-link:hover {
    opacity: 1;
    color: #258cfb;
}

.auth-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 520px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(20, 40, 80, 0.18);
    overflow: hidden;
}

/* ---------- form panels ---------- */
.auth-form-panel {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    display: flex;
    align-items: center;
    transition: all 0.6s ease-in-out;
}

.auth-form-panel form {
    width: 100%;
    padding: 0 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.auth-panel-signin {
    left: 0;
    z-index: 2;
}

.auth-panel-signup {
    left: 0;
    opacity: 0;
    z-index: 1;
}

.auth-container.is-active .auth-panel-signin {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
}

.auth-container.is-active .auth-panel-signup {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: auth-show 0.6s;
}

@keyframes auth-show {
    0%, 49.99% { opacity: 0; z-index: 1; }
    50%, 100% { opacity: 1; z-index: 5; }
}

.auth-form-panel h2 {
    font-weight: 700;
    font-size: 26px;
    margin-bottom: 6px;
    color: #1c2430;
}

.auth-social {
    display: flex;
    gap: 10px;
    margin: 14px 0 10px;
}

.auth-social a {
    width: 38px;
    height: 38px;
    border: 1px solid #e2e6ec;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    transition: background .2s;
}

.auth-social a:hover {
    background: #f2f5fa;
}

.auth-form-panel span.auth-hint {
    font-size: 12px;
    color: #8992a3;
    margin-bottom: 14px;
}

.auth-input {
    background: #f3f5f9;
    border: 1px solid transparent;
    padding: 12px 14px;
    margin: 6px 0;
    width: 100%;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, background .2s;
}

.auth-input:focus {
    background: #fff;
    border-color: #258cfb;
}

.auth-error {
    color: #e74c3c;
    font-size: 12.5px;
    align-self: flex-start;
    margin: -2px 0 4px 2px;
}

.auth-forgot {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    margin: 12px 0;
}

.auth-forgot:hover {
    color: #258cfb;
}

.auth-btn {
    border-radius: 24px;
    border: none;
    background: linear-gradient(135deg, #258cfb, #1b63c9);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 42px;
    cursor: pointer;
    margin-top: 8px;
    transition: transform .15s, box-shadow .15s;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(37, 140, 251, .3);
}

.auth-btn.ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,.8);
    box-shadow: none;
}

.auth-btn.ghost:hover {
    background: rgba(255,255,255,.1);
    box-shadow: none;
    transform: translateY(-1px);
}

/* ---------- overlay ---------- */
.auth-overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.auth-container.is-active .auth-overlay-container {
    transform: translateX(-100%);
}

.auth-overlay {
    background: linear-gradient(135deg, #258cfb 0%, #1b3f8f 100%);
    color: #fff;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.auth-container.is-active .auth-overlay {
    transform: translateX(50%);
}

.auth-overlay-panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    top: 0;
    height: 100%;
    width: 50%;
    padding: 0 42px;
    text-align: center;
    transition: transform 0.6s ease-in-out;
}

.auth-overlay-panel h2 {
    font-weight: 700;
    font-size: 26px;
    margin-bottom: 14px;
}

.auth-overlay-panel p {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 22px;
    opacity: .9;
}

.auth-overlay-left {
    transform: translateX(-20%);
}

.auth-container.is-active .auth-overlay-left {
    transform: translateX(0);
}

.auth-overlay-right {
    right: 0;
    transform: translateX(0);
}

.auth-container.is-active .auth-overlay-right {
    transform: translateX(20%);
}

.auth-alert {
    width: 100%;
    max-width: 340px;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
}

@media (max-width: 767px) {
    .auth-container {
        min-height: 0;
        border-radius: 14px;
    }

    .auth-overlay-container,
    .auth-form-panel {
        position: relative;
        width: 100%;
        left: 0;
        transition: none;
    }

    .auth-overlay-container {
        display: none;
    }

    .auth-panel-signup {
        display: none;
    }

    .auth-container.is-active .auth-panel-signin {
        display: none;
        transform: none;
    }

    .auth-container.is-active .auth-panel-signup {
        display: flex;
        opacity: 1;
        transform: none;
        animation: none;
    }

    .auth-form-panel form {
        padding: 36px 28px;
    }

    .auth-mobile-toggle {
        text-align: center;
        padding: 18px;
        font-size: 13.5px;
        color: #6b7280;
        border-top: 1px solid #eef1f6;
    }

    .auth-mobile-toggle a {
        color: #258cfb;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
    }
}

@media (min-width: 768px) {
    .auth-mobile-toggle {
        display: none;
    }
}

/* ---------- wide variant (long forms, e.g. Company Register) ---------- */
.auth-container.auth-wide {
    max-width: 980px;
    min-height: 620px;
}

.auth-container.auth-wide .auth-form-panel {
    align-items: stretch;
}

.auth-container.auth-wide .auth-form-panel form {
    max-height: 620px;
    overflow-y: auto;
    padding: 40px 50px;
    scrollbar-width: thin;
}

.auth-container.auth-wide .auth-form-panel form::-webkit-scrollbar {
    width: 6px;
}

.auth-container.auth-wide .auth-form-panel form::-webkit-scrollbar-thumb {
    background: #d7dee8;
    border-radius: 6px;
}

.auth-field-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.auth-field-row .auth-input {
    width: 100%;
}

.auth-section-label {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #258cfb;
    margin: 14px 0 2px;
}

@media (max-width: 767px) {
    .auth-container.auth-wide .auth-form-panel form {
        max-height: none;
        overflow: visible;
    }
}

/* ---------- RTL mirroring ---------- */
html[dir="rtl"] .auth-back-link {
    left: auto;
    right: 24px;
}

html[dir="rtl"] .auth-overlay-container {
    left: 0;
}

html[dir="rtl"] .auth-container.is-active .auth-overlay-container {
    transform: translateX(100%);
}

html[dir="rtl"] .auth-container.is-active .auth-panel-signin {
    transform: translateX(-100%);
}

html[dir="rtl"] .auth-container.is-active .auth-panel-signup {
    transform: translateX(-100%);
}

html[dir="rtl"] .auth-overlay {
    left: 0;
    transform: translateX(0);
}

html[dir="rtl"] .auth-container.is-active .auth-overlay {
    transform: translateX(-50%);
}

html[dir="rtl"] .auth-overlay-right {
    right: auto;
    left: 0;
}
