/* ==========================================================
   Modern Auth UI — Phone Login & OTP Verification
   ========================================================== */

@font-face {
    font-family: MyanmarSagar;
    src: url('./../fonts/custom/myanmar_sagar.ttf');
}

:root {
    --brand: #365CA9;
    --brand-dark: #27447e;
    --brand-light: #5b7fc7;
    --accent: #4f8ef7;
    --ink: #1e293b;
    --muted: #64748b;
    --danger: #e11d48;
    --ring: rgba(79, 142, 247, 0.35);
    --card-bg: rgba(255, 255, 255, 0.92);
}

* {
    font-family: MyanmarSagar, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a6e 0%, #365CA9 45%, #4f8ef7 100%);
    padding: 1.5rem;
}

/* --- Backdrop photo + overlay --- */
.auth-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.auth-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.18;
    user-select: none;
    pointer-events: none;
}

/* --- Decorative floating blobs --- */
.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    z-index: 1;
    animation: blobFloat 12s ease-in-out infinite alternate;
    pointer-events: none;
}

.auth-blob--one {
    width: 420px;
    height: 420px;
    top: -120px;
    left: -100px;
    background: #6ea8ff;
}

.auth-blob--two {
    width: 360px;
    height: 360px;
    bottom: -100px;
    right: -80px;
    background: #2b4d92;
    animation-delay: -6s;
}

@keyframes blobFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, 30px) scale(1.08); }
}

/* --- Card --- */
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    animation: cardIn 0.5s ease-out both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-brand h1 {
    font-size: 1.35rem;
    letter-spacing: 0.18em;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.auth-brand span {
    display: block;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0.35rem;
    text-transform: uppercase;
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 1.25rem;
    box-shadow: 0 24px 60px rgba(15, 30, 70, 0.45);
    padding: 2.25rem 2rem;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.auth-logo img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    border-radius: 1rem;
    background: #fff;
    padding: 0.5rem;
    box-shadow: 0 8px 24px rgba(54, 92, 169, 0.25);
}

.auth-title {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.auth-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.auth-subtitle strong {
    color: var(--brand);
}

/* --- Phone input --- */
.auth-field {
    position: relative;
    margin-bottom: 1rem;
}

.auth-field .field-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input {
    width: 100%;
    height: 3.25rem;
    border: 1.5px solid #dbe2ef;
    border-radius: 0.75rem;
    background: #fff;
    padding: 0 1rem 0 2.9rem;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input::placeholder {
    color: #a9b4c6;
    letter-spacing: 0.06em;
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--ring);
}

.auth-field:focus-within .field-icon {
    color: var(--accent);
}

/* --- OTP boxes --- */
.otp-group {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.otp-input {
    width: 3rem;
    height: 3.5rem;
    border: 1.5px solid #dbe2ef;
    border-radius: 0.75rem;
    background: #fff;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    outline: none;
    caret-color: var(--accent);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.otp-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--ring);
    transform: translateY(-2px);
}

.otp-input.is-filled {
    border-color: var(--brand);
    background: #f2f6ff;
}

/* --- Buttons --- */
.auth-btn {
    width: 100%;
    height: 3.25rem;
    border: none;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 10px 24px rgba(54, 92, 169, 0.4);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(54, 92, 169, 0.5);
    filter: brightness(1.05);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn[disabled] {
    cursor: not-allowed;
    filter: grayscale(0.2) brightness(0.95);
}

.auth-btn .spinner {
    width: 1.15rem;
    height: 1.15rem;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Error + links --- */
.auth-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    font-size: 0.85rem;
    border-radius: 0.6rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.auth-footer-link {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

.auth-footer-link a {
    color: var(--brand);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
}

.auth-footer-link a:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.auth-copy {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.05em;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    body.auth-page {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 1rem;
    }

    .auth-brand h1 {
        font-size: 1.1rem;
        letter-spacing: 0.12em;
    }

    .auth-logo img {
        width: 68px;
        height: 68px;
    }

    .otp-group {
        gap: 0.4rem;
    }

    .otp-input {
        width: 2.6rem;
        height: 3.1rem;
        font-size: 1.3rem;
    }
}

@media (max-width: 340px) {
    .otp-input {
        width: 2.3rem;
        height: 2.8rem;
        font-size: 1.15rem;
    }
}
