/* ─── Base ─── */
html, body {
    height: 100%;
    margin: 0;
}

body.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--kt-font-sans);
}

body.auth-page * {
    font-family: var(--kt-font-sans);
}

.auth-logo-text {
    font-family: var(--kt-font-sans) !important;
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
}

.body-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ─── Keyframes ─── */
@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes authFloat {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(12px, -18px); }
}

@keyframes authFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-14px, 14px); }
}

@keyframes authFloat3 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(8px, 12px); }
}

@keyframes authGradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes authPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(65, 84, 241, 0.3); }
    50%      { box-shadow: 0 0 0 10px rgba(65, 84, 241, 0); }
}

/* ─── Auth Section ─── */
.auth-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at top right, rgba(97, 122, 255, 0.22), transparent 28%),
        radial-gradient(circle at bottom left, rgba(72, 198, 173, 0.12), transparent 30%),
        linear-gradient(160deg, #0b1331 0%, #101a42 48%, #172459 100%);
    position: relative;
    padding: 100px 20px 40px;
    overflow: hidden;
}

.auth-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/loginbackground.jpg') center/cover no-repeat;
    opacity: 0.08;
    pointer-events: none;
}

.auth-layout {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}

.auth-showcase {
    flex: 0 0 470px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 56px;
    animation: authFadeUp 0.6s ease-out both;
}

.auth-showcase-content {
    max-width: 430px;
}

.auth-showcase-content h1 {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    line-height: 1.14;
    margin: 0 0 18px;
    letter-spacing: -0.04em;
}

.auth-showcase .reg-subtitle {
    margin-bottom: 28px;
}

.auth-showcase .reg-features {
    margin-bottom: 24px;
}

/* ─── Floating orbs ─── */
.auth-decor {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(72px);
    opacity: 0.26;
    z-index: 0;
}

.auth-decor--1 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(65,84,241,0.5), transparent 70%);
    top: -60px;
    right: -80px;
    animation: authFloat 8s ease-in-out infinite;
}

.auth-decor--2 {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(111,127,245,0.4), transparent 70%);
    bottom: -40px;
    left: -60px;
    animation: authFloat2 10s ease-in-out infinite;
}

.auth-decor--3 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(99,215,190,0.35), transparent 70%);
    top: 40%;
    left: 15%;
    animation: authFloat3 12s ease-in-out infinite;
}

/* ─── Auth Card ─── */
.auth-card-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    animation: authFadeUp 0.6s ease-out both;
}

.auth-card-wrap--split {
    flex: 1;
    max-width: none;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 40px 40px 8px;
    margin: 0;
}

.auth-card-wrap--split .auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-layout--centered {
    justify-content: center;
}

.auth-card-wrap.wide {
    max-width: 720px;
}

.auth-card {
    background: linear-gradient(135deg, #243b8f 0%, #3550bb 58%, #5672de 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 24px;
    border: 1px solid rgba(96, 122, 245, 0.26);
    box-shadow:
        0 20px 44px rgba(3, 13, 40, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    isolation: isolate;
    background-clip: padding-box;
}

.auth-card:hover {
    transform: translateY(-1px);
    box-shadow:
        0 24px 52px rgba(3, 13, 40, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.auth-card::before,
.reg-form-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ─── Auth Header ─── */
.auth-header {
    background: linear-gradient(135deg, #243b8f 0%, #3550bb 58%, #5672de 100%);
    padding: 20px 24px 18px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.auth-header-icon-center {
    margin: 0 auto 10px;
}

.auth-header h2 {
    color: #fff;
    font-size: 21px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    margin: 5px 0 0;
    font-weight: 500;
    line-height: 1.5;
}

/* ─── Auth Body ─── */
.auth-body {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px 24px 24px;
}

.auth-body .form-group {
    margin-bottom: 14px;
}

.auth-body .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #30415d;
    margin-bottom: 5px;
    display: block;
    letter-spacing: 0.2px;
}

.auth-body .form-control {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #d8dfeb;
    padding: 8px 14px;
    font-size: 13px;
    color: #1a1a2e;
    background: #f7f9fc;
    transition: all 0.25s ease;
}

.auth-body .form-control:focus {
    border-color: #4154f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(65, 84, 241, 0.1);
    outline: none;
}

.auth-body .form-control::placeholder {
    color: #a0a8b8;
}

.auth-body select.form-control {
    appearance: auto;
}

.auth-body textarea.form-control {
    height: auto;
    min-height: 90px;
    resize: vertical;
}

/* ─── Auth Button ─── */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    width: 100%;
    padding: 0 48px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #2f47b8 0%, #4763de 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.auth-btn::after {
    display: none;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(47, 71, 184, 0.28);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(65, 84, 241, 0.3);
}

/* ─── Divider & Links ─── */
.auth-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #dde4ef, transparent);
    margin: 16px 0 12px;
}

.auth-links {
    text-align: center;
    padding-top: 4px;
}

.auth-links p {
    font-size: 13px;
    color: #607086;
    margin: 6px 0;
}

.auth-links a {
    color: #3652c9;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.auth-links a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: #3652c9;
    transition: width 0.3s ease;
}

.auth-links a:hover {
    color: #2742b3;
}

.auth-links a:hover::after {
    width: 100%;
}

/* ─── Error Message ─── */
.auth-error {
    font-size: 12px;
    font-weight: 600;
    color: #dc3545;
    text-align: center;
    margin: 10px 0 0;
    min-height: 18px;
    padding: 0 8px;
    border-radius: 8px;
    transition: all 0.3s;
}

.auth-error:not(:empty) {
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 10px 14px;
}

/* ─── Password Wrapper ─── */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #868e96;
    transition: color 0.2s;
    padding: 4px;
    line-height: 1;
}

.toggle-password:hover {
    color: #4154f1;
}

/* ─── Password Strength ─── */
.pw-strength {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pw-bar {
    flex: 1;
    height: 4px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.pw-bar-fill {
    height: 100%;
    width: 0%;
    background: tomato;
    transition: width 0.25s ease, background 0.25s ease;
    border-radius: 3px;
}

.pw-label {
    min-width: 70px;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
}

.password-tooltip {
    margin-top: 6px;
    font-size: 11px;
    color: #555;
    display: none;
}

.password-tooltip .invalid { color: #d9534f; }
.password-tooltip .valid { color: #174d8c; }

.match-indicator {
    font-size: 11px;
    margin-top: 4px;
    color: #6c757d;
    font-weight: 500;
}

.match-indicator.match { color: #174d8c; }
.match-indicator.nomatch { color: #d9534f; }

.password-help-short {
    font-size: 11px;
    color: #868e96;
    margin-top: 4px;
}

.form-text {
    font-size: 12px;
    color: #868e96;
    margin-top: 6px;
}

/* ─── Auth Footer ─── */
.auth-footer {
    text-align: center;
    padding: 16px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.auth-footer a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ─── Register Section ─── */
.reg-section {
    flex: 1;
    display: flex;
    align-items: stretch;
    background:
        radial-gradient(circle at top right, rgba(97, 122, 255, 0.22), transparent 28%),
        radial-gradient(circle at 10% 80%, rgba(72, 198, 173, 0.12), transparent 30%),
        linear-gradient(160deg, #0b1331 0%, #101a42 48%, #172459 100%);
    padding: 80px 0 0;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.reg-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/loginbackground.jpg') center/cover no-repeat;
    opacity: 0.06;
    pointer-events: none;
}

.reg-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
    position: relative;
    z-index: 1;
}

.reg-left {
    flex: 0 0 470px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 56px;
    animation: authFadeUp 0.6s ease-out both;
}

.reg-left-content {
    max-width: 410px;
}

.reg-left-content h1 {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    line-height: 1.14;
    margin: 0 0 18px;
    letter-spacing: -0.04em;
}

.reg-subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.74);
    line-height: 1.7;
    margin: 0 0 32px;
    font-weight: 400;
}

.reg-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.reg-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.reg-feature > div {
    min-width: 0;
}

.reg-feature-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    background: rgba(72, 95, 214, 0.22);
    border: 1px solid rgba(144, 160, 255, 0.14);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b9c4ff;
    font-size: 16px;
}

.reg-feature:hover .reg-feature-icon {
    background: rgba(72, 95, 214, 0.22);
    color: #b9c4ff;
}

.reg-feature:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.12);
}

.reg-feature strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.35;
}

.reg-feature span {
    font-size: 13px;
    color: rgba(255,255,255,0.66);
    line-height: 1.55;
}

.reg-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
}

.reg-trust i {
    color: #6dd58c;
    font-size: 18px;
    flex-shrink: 0;
}

.reg-trust span {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

.reg-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 40px 40px 8px;
    animation: authFadeUp 0.6s 0.15s ease-out both;
}

.reg-form-card {
    width: 100%;
    max-width: 560px;
    background: linear-gradient(135deg, #243b8f 0%, #3550bb 58%, #5672de 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 24px;
    border: 1px solid rgba(96, 122, 245, 0.26);
    box-shadow:
        0 20px 44px rgba(3, 13, 40, 0.22),
        inset 0 1px 0 rgba(255,255,255,0.6);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    isolation: isolate;
    background-clip: padding-box;
}

.reg-form-card:hover {
    transform: translateY(-1px);
    box-shadow:
        0 24px 52px rgba(3, 13, 40, 0.25),
        inset 0 1px 0 rgba(255,255,255,0.6);
}

.reg-form-header {
    background: linear-gradient(135deg, #243b8f 0%, #3550bb 58%, #5672de 100%);
    padding: 18px 24px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.reg-form-header h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.3px;
}

.reg-form-header p {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    margin: 2px 0 0;
    font-weight: 500;
}

.reg-form-body {
    background: rgba(255,255,255,0.98);
    padding: 18px 26px 20px;
}

.reg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 6px;
}

.reg-row-single {
    grid-template-columns: 1fr;
    max-width: 50%;
}

.reg-field {
    display: flex;
    flex-direction: column;
}

.reg-label {
    font-size: 11px;
    font-weight: 600;
    color: #30415d;
    margin-bottom: 5px;
    display: block;
    letter-spacing: 0.2px;
}

.reg-input {
    height: 38px;
    border-radius: 9px;
    border: 1px solid #d8dfeb;
    padding: 7px 13px;
    font-size: 12.5px;
    color: #1a1a2e;
    background: #f7f9fc;
    transition: all 0.25s ease;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.reg-input:focus {
    border-color: #4154f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(65,84,241,0.1);
    outline: none;
}

.reg-select {
    appearance: auto;
}

.reg-submit {
    text-align: center;
    margin-top: 10px;
}

.reg-submit .auth-btn {
    height: 42px;
    font-size: 13px;
    border-radius: 11px;
    min-width: 240px;
}

.reg-form-body .pw-strength {
    margin-top: 4px;
    gap: 6px;
}

.reg-form-body .pw-label,
.reg-form-body .match-indicator,
.reg-form-body .password-help-short,
.reg-form-body .form-text {
    font-size: 10px;
}

.reg-form-body .match-indicator {
    margin-top: 3px;
}

.reg-form-body .password-help-short,
.reg-form-body .form-text,
.reg-form-body .password-tooltip {
    margin-top: 3px;
}

.reg-form-body .password-tooltip {
    font-size: 10px;
}

.reg-form-body .password-wrapper input {
    padding-right: 40px;
}

.reg-form-body .toggle-password {
    right: 10px;
    font-size: 1rem;
}

.reg-form-body .auth-divider {
    margin: 16px 0 12px;
}

.reg-form-body .auth-links p {
    margin: 6px 0;
    font-size: 13px;
}

.reg-educator-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 6px;
    padding: 10px 12px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    font-size: 11.5px;
    color: #3730a3;
    line-height: 1.45;
}

.reg-educator-notice.is-hidden {
    display: none;
}

.reg-educator-notice i {
    flex-shrink: 0;
    font-size: 14px;
    color: #4f46e5;
    margin-top: 1px;
}

@media (max-width: 991px) {
    .auth-layout {
        flex-direction: column;
        justify-content: flex-start;
        min-height: auto;
        gap: 20px;
    }

    .auth-showcase {
        flex: none;
        width: 100%;
        padding: 24px 20px 0;
    }

    .auth-showcase-content {
        max-width: 100%;
        text-align: center;
    }

    .auth-showcase-content h1 {
        font-size: 28px;
    }

    .auth-card-wrap--split {
        flex: none;
        max-width: 420px;
        width: 100%;
        display: block;
        padding: 0;
        margin: 0;
    }

    .reg-container {
        flex-direction: column;
        min-height: auto;
    }

    .reg-left {
        flex: none;
        padding: 40px 24px 20px;
    }

    .reg-left-content {
        max-width: 100%;
        text-align: center;
    }

    .reg-left-content h1 {
        font-size: 26px;
    }

    .reg-subtitle {
        margin-bottom: 24px;
    }

    .reg-features {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        margin-bottom: 24px;
    }

    .reg-feature {
        text-align: left;
    }

    .reg-trust {
        justify-content: center;
    }

    .reg-right {
        padding: 0 24px 40px;
    }

    .reg-form-card {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .auth-section {
        padding: 90px 16px 24px;
        align-items: flex-start;
    }

    .auth-layout {
        gap: 16px;
    }

    .auth-showcase {
        padding: 16px 6px 0;
    }

    .auth-showcase-content h1 {
        font-size: 24px;
    }

    .auth-showcase .reg-features {
        gap: 12px;
        margin-bottom: 18px;
    }

    .auth-header {
        padding: 18px 18px 16px;
    }

    .auth-header-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 14px;
        margin-bottom: 10px;
    }

    .auth-body {
        padding: 18px;
    }

    .auth-decor--1,
    .auth-decor--3 {
        display: none;
    }

    .auth-decor--2 {
        width: 180px;
        height: 180px;
    }

    .pw-label {
        display: none;
    }

    .password-wrapper input {
        padding-right: 44px;
    }

    .reg-section {
        padding-top: 70px;
    }

    .reg-left {
        padding: 30px 20px 16px;
    }

    .reg-left-content h1 {
        font-size: 22px;
    }

    .reg-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .reg-right {
        padding: 0 16px 30px;
    }

    .reg-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .reg-row-single {
        max-width: 100%;
    }

    .reg-form-body {
        padding: 16px 18px 18px;
    }

    .reg-form-header {
        padding: 16px 18px;
    }

    .reg-form-header h2 {
        font-size: 18px;
    }
}
