/* ==========================================================
   Design tokens (shared with login.css)
   ========================================================== */
:root {
    --ink-900: #0F1B33;
    --ink-800: #16264A;
    --ink-700: #2B3C63;
    --gold-500: #C79A45;
    --gold-400: #DDB668;
    --gold-100: #F6E9CE;
    --paper-0: #FFFFFF;
    --paper-50: #F5F6FA;
    --paper-100: #ECEEF4;
    --text-body: #3C4457;
    --text-muted: #6B7488;
    --danger: #D64545;
    --success: #2E9E5B;

    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-card: 0 24px 60px -20px rgba(15, 27, 51, 0.28);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* Fixed control height so icon/button vertical position is
       predictable and never depends on how tall .input-wrap
       becomes (e.g. when a pill button wraps to its own row) */
    --control-h: 3rem;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-body);
    margin: 0;
    overflow-x: hidden;
    background-color: var(--paper-50);
    background-image:
        radial-gradient(900px 480px at 92% -8%, rgba(199, 154, 69, 0.16), transparent 60%),
        radial-gradient(700px 500px at -10% 100%, rgba(43, 60, 99, 0.10), transparent 55%),
        radial-gradient(circle, rgba(43, 60, 99, 0.08) 1px, transparent 1px);
    background-size: auto, auto, 26px 26px;
    background-repeat: no-repeat, no-repeat, repeat;
}

h1,
h2 {
    font-family: var(--font-display);
    color: var(--ink-900);
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--ink-900);
    color: #fff;
    padding: 0.75rem 1.25rem;
    z-index: 2000;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    left: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--gold-500);
    outline-offset: 3px;
}

/* ==========================================================
   Layout
   ========================================================== */
.login-page {
    min-height: 100svh;
}

.login-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem clamp(1rem, 3vw, 2.5rem);
}

.login-col-inner {
    width: 100%;
    max-width: 420px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    margin-bottom: 2rem;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--gold-400), var(--gold-500));
    color: var(--ink-900);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-display);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-title {
    color: var(--ink-900);
    font-weight: 700;
    font-size: 0.95rem;
}

.brand-sub {
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* ==========================================================
   Card
   ========================================================== */
.login-card {
    background: var(--paper-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.5rem, 3vw, 2.25rem);
    animation: cardIn 0.6s var(--ease) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge-pill {
    display: inline-block;
    background: var(--gold-100);
    color: #7A5A1E;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.login-card h1 {
    font-weight: 600;
    font-size: clamp(1.45rem, 2.4vw, 1.75rem);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.login-sub {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* ==========================================================
   Stepper
   ========================================================== */
.stepper {
    margin-bottom: 1.75rem;
}

.stepper-track {
    height: 6px;
    background: var(--paper-100);
    border-radius: 999px;
    overflow: hidden;
}

.stepper-fill {
    display: block;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, var(--gold-400), var(--gold-500));
    border-radius: 999px;
    transition: width 0.4s var(--ease);
}

.stepper-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.stepper-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s var(--ease);
}

.stepper-label.is-active {
    color: var(--ink-900);
}

.stepper-label.is-done {
    color: var(--success);
}

/* ==========================================================
   Form
   ========================================================== */
.step-panel {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
    animation: panelIn 0.4s var(--ease) both;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group {
    margin-bottom: 1.35rem;
}

.form-row {
    display: flex;
    gap: 0.9rem;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-800);
    margin-bottom: 0.5rem;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/*
   .input-core wraps ONLY the icon + the <input>/<select>.
   This is the key fix: fields that also contain a pill button
   (Send OTP / Verify) used to put the icon and the button as
   siblings directly inside .input-wrap. On mobile the pill
   button switches to position:static and wraps onto its own
   row, which inflates .input-wrap's height and drags the
   icon's positioning reference down with it, so the icon ends
   up floating below the field instead of centered inside it.

   By scoping the icon to a wrapper that contains nothing but
   the icon and the input, that wrapper's height is always
   exactly the input's height (var(--control-h)) no matter what
   the button sibling does, so the icon stays correctly centred
   in every layout/breakpoint.
*/
.input-core {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: calc(var(--control-h) / 2);
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.05rem;
    pointer-events: none;
    z-index: 1;
}

.input-wrap input,
.input-wrap select {
    width: 100%;
    height: var(--control-h);
    padding: 0 1rem 0 2.75rem;
    border: 1.5px solid var(--paper-100);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.96rem;
    color: var(--ink-900);
    background: var(--paper-50);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%236B7488' stroke-width='1.6' fill='none' fill-rule='evenodd'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.25rem;
}

.input-wrap input::placeholder {
    color: #A6ACBB;
}

.input-wrap input:focus,
.input-wrap select:focus {
    outline: none;
    border-color: var(--gold-500);
    background: var(--paper-0);
    box-shadow: 0 0 0 4px rgba(199, 154, 69, 0.14);
}

.input-wrap input.is-invalid,
.input-wrap select.is-invalid {
    border-color: var(--danger);
    background: #FDF3F3;
}

.input-wrap input.is-invalid:focus,
.input-wrap select.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.12);
}

.input-wrap input.is-valid {
    border-color: var(--success);
}

/* Strip native browser reveal/spinner controls */
.input-wrap input[type="password"]::-ms-reveal,
.input-wrap input[type="password"]::-ms-clear,
.input-wrap input[type="number"]::-webkit-inner-spin-button,
.input-wrap input[type="number"]::-webkit-outer-spin-button {
    display: none;
}

.input-wrap input::-webkit-textfield-decoration-container,
.input-wrap input::-webkit-credentials-auto-fill-button,
.input-wrap input::-webkit-strong-password-auto-fill-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

/* Phone prefix */
.input-prefix {
    position: absolute;
    left: 2.75rem;
    top: calc(var(--control-h) / 2);
    transform: translateY(-50%);
    color: var(--text-body);
    font-weight: 600;
    font-size: 0.92rem;
    pointer-events: none;
    z-index: 1;
}

#phone {
    padding-left: 4.3rem;
}

/* Password / OTP toggle buttons living inside the field */
.toggle-password,
.pill-action {
    position: absolute;
    top: calc(var(--control-h) / 2);
    transform: translateY(-50%);
    border: none;
    cursor: pointer;
    z-index: 2;
}

.toggle-password {
    right: 0.4rem;
    width: 2.1rem;
    height: 2.1rem;
    background: none;
    color: var(--text-muted);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.toggle-password i {
    font-size: 1.05rem;
    line-height: 1;
}

.toggle-password:hover {
    color: var(--ink-900);
    background: var(--paper-100);
}

#reg_password,
#confirm_password {
    padding-right: 2.75rem;
}

.pill-action {
    right: 0.35rem;
    background: var(--ink-900);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.2s var(--ease), opacity 0.2s var(--ease), transform 0.15s var(--ease);
}

.pill-action:hover:not(:disabled) {
    background: var(--ink-800);
}

.pill-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#reg_email {
    padding-right: 6rem;
}

.otp-input {
    padding-right: 5.25rem;
    letter-spacing: 0.5em;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

#reg_otp {
    padding-right: 5.5rem;
}

.otp-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
    gap: 0.75rem;
}

.resend-link {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-700);
    cursor: pointer;
    white-space: nowrap;
}

.resend-link:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.resend-link:not(:disabled):hover {
    color: var(--gold-500);
}

.otp-expiry {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.55rem;
    padding: 0.38rem 0.55rem;
    border-radius: 8px;
    color: var(--ink-700);
    background: var(--paper-50);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
}

.otp-expiry i {
    color: var(--gold-500);
}

.otp-expiry strong {
    color: var(--ink-900);
}

.otp-expiry.is-expired {
    color: var(--danger);
    background: #FFF1F1;
}

.otp-expiry.is-expired i,
.otp-expiry.is-expired strong {
    color: var(--danger);
}

.verified-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: #EEF8F1;
    color: var(--success);
    border: 1.5px solid #CFEBD9;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.verified-banner i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.verified-banner strong {
    font-weight: 700;
    word-break: break-all;
}

.change-email-link {
    margin-left: auto;
    border: none;
    background: none;
    color: var(--ink-700);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    flex-shrink: 0;
}

/* Password rule checklist */
.password-rules {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.5rem;
}

.password-rules li {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s var(--ease);
}

.password-rules li i {
    font-size: 0.9rem;
}

.password-rules li.is-met {
    color: var(--success);
}

.password-rules li.is-met i::before {
    content: "\F26A";
    /* bi-check-circle-fill */
}

.field-error {
    display: none;
    min-height: 1.1rem;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.remember-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: var(--text-body);
    cursor: pointer;
    user-select: none;
    line-height: 1.5;
}

.remember-check input {
    width: 16px;
    height: 16px;
    margin-top: 0.2rem;
    accent-color: var(--gold-500);
    cursor: pointer;
    flex-shrink: 0;
}

.remember-check a {
    color: var(--ink-800);
    font-weight: 600;
}

.btn-custom {
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.96rem;
    border: none;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
}

.btn-primary.btn-custom {
    background: var(--ink-900);
}

.btn-primary.btn-custom:hover:not(:disabled) {
    background: var(--ink-800);
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -12px rgba(15, 27, 51, 0.5);
}

.btn-primary.btn-custom:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-custom {
    background: transparent;
    color: var(--ink-800);
    border: 1.5px solid var(--paper-100);
    flex: 0 0 auto;
}

.btn-outline-custom:hover {
    background: var(--paper-100);
}

.step-actions {
    margin-top: 1.75rem;
    align-items: stretch;
}

.signup-note {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 1.75rem 0 0;
}

.signup-note a {
    color: var(--ink-900);
    font-weight: 600;
    text-decoration: none;
}

.signup-note a:hover {
    color: var(--gold-500);
}

/* ==========================================================
   Image column
   ========================================================== */
.login-image-col {
    position: relative;
}

.image-area {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.image-area::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(200deg, rgba(15, 27, 51, 0.15) 0%, rgba(15, 27, 51, 0.55) 60%, rgba(15, 27, 51, 0.92) 100%);
    z-index: 1;
}

.image-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-overlay-content {
    position: absolute;
    left: 2rem;
    right: 2rem;
    bottom: 2.5rem;
    z-index: 2;
    color: #fff;
}

.image-overlay-content .badge-pill {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    backdrop-filter: blur(4px);
}

.image-overlay-content h2 {
    color: #fff;
    font-weight: 600;
    font-size: 1.6rem;
    line-height: 1.2;
    margin: 0.75rem 0 0.6rem;
}

.image-overlay-content .in-jntuk {
    color: var(--gold-400);
    font-style: italic;
}

.image-overlay-content p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.92rem;
    margin: 0;
    max-width: 30ch;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .login-col-inner {
        max-width: 340px;
    }

    .login-card h1 {
        font-size: 1.3rem;
    }
}

@media (max-width: 991.98px) {
    .login-col {
        min-height: 100svh;
        padding: 2rem 1.25rem;
    }

    .login-card {
        padding: 2.25rem 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .brand-sub {
        display: none;
    }

    .login-sub {
        display: none;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--radius-md);
    }

    .login-card h1 {
        font-size: 1.15rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .input-icon{
        /*top: 28% !important;*/
        display: none;
    }

    .password-rules {
        grid-template-columns: 1fr;
    }

    #reg_email {
        padding-right: 1rem;
    }

    .pill-action {
        position: static;
        top: auto;
        transform: none;
        width: 100%;
        margin-top: 0.6rem;
        padding: 0.7rem 0.85rem;
    }

    #reg_email,
    .otp-input {
        padding-right: 1rem;
    }

    .input-wrap {
        flex-wrap: wrap;
    }

    .input-core {
        flex: 1 1 100%;
    }

    .step-actions {
        flex-direction: column-reverse;
    }

    .btn-outline-custom {
        width: 100%;
    }
}

/* ==========================================================
   Motion preference
   ========================================================== */
@media (prefers-reduced-motion: reduce) {

    .login-card,
    .step-panel {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}