/* ====================================================
   Public Layout – clean centered card (Hostinger style)
   ==================================================== */

/* ?? Page shell ?? */
.public-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f7f8fa;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ?? Top nav ?? */
.public-nav {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 32px;
}

.public-nav-inner {
    width: 100%;
    display: flex;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-logo-img {
    height: 120px;
    width: auto;
    object-fit: contain;
}

.nav-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}

/* ?? Main content area ?? */
.public-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.public-card-wrap {
    width: 100%;
    max-width: 480px;
}

/* ?? Login card ?? */
.login-container {
    width: 100%;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8eaed;
    animation: fadeInUp 0.35s ease-out;
}

/* ?? Header ?? */
.login-header {
    margin-bottom: 28px;
    text-align: center;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 6px 0;
    letter-spacing: -0.4px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

/* ?? Field labels ?? */
.field-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    margin-top: 16px;
}

.field-label:first-of-type {
    margin-top: 0;
}

/* -- Password field wrapper -- */
.password-field-wrap {
    position: relative;
}

.password-eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    z-index: 2;
}

.password-eye-btn:hover {
    color: #4a2c8a;
}

.password-eye-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* push input text left of the eye icon */
.password-field-wrap .mud-input-slot input {
    padding-right: 44px !important;
}

/* ?? MFA code input ?? */
.mfa-code-wrap {
    width: 100%;
    margin-bottom: 8px;
}

.mfa-code-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 12px;
    text-align: center;
    letter-spacing: 0.65em;
    font-size: 1.7rem;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    color: #1e293b;
    background: #ffffff;
    border: 2px solid #a78bfa;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mfa-code-input::placeholder {
    color: #cbd5e1;
    letter-spacing: 0.4em;
    font-weight: 400;
    font-size: 1.4rem;
}

.mfa-code-input:focus {
    border-color: #4a2c8a;
    box-shadow: 0 0 0 3px rgba(74, 44, 138, 0.15);
}

/* -- MudBlazor input overrides -- */
.login-container .mud-input-root {
    margin-bottom: 0;
}

.login-container .mud-input {
    border-radius: 8px;
    background-color: #ffffff;
}

.login-container .mud-input-outlined .mud-notched-outline {
    border-color: #d1d5db;
}

.login-container .mud-input-outlined:hover .mud-notched-outline {
    border-color: #9ca3af;
}

.login-container .mud-input-outlined.mud-input-focused .mud-notched-outline {
    border-color: #4a2c8a;
    border-width: 2px;
}

.login-container .mud-input-control {
    margin-top: 0;
}

/* ?? Error banner ?? */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* ?? Forgot password row ?? */
.forgot-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    margin-bottom: 4px;
}

.login-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: #4a2c8a;
    text-decoration: none;
    transition: color 0.15s ease;
}

.login-link:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* ?? Submit button ?? */
.login-container .mud-button-root {
    text-transform: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    box-shadow: none;
    letter-spacing: 0;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.login-container .mud-button-filled-primary {
    background: #4a2c8a;
}

.login-container .mud-button-filled-primary:hover {
    background: #5d3aab;
    box-shadow: 0 4px 14px rgba(74, 44, 138, 0.3);
}

.login-container .mud-button-filled-primary:active {
    background: #3b2270;
    box-shadow: none;
}

/* ?? MudGrid inside card ?? */
.login-container .mud-grid {
    margin: 0;
    width: 100%;
}

.login-container .mud-grid-item {
    padding: 0;
    margin-bottom: 16px;
}

.login-container .mud-grid-item:last-child {
    margin-bottom: 0;
}

/* ?? Spinner ?? */
.login-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes login-spin { to { transform: rotate(360deg); } }

/* ?? Footer ?? */
.public-footer {
    padding: 20px 24px;
    text-align: center;
    border-top: 1px solid #e8eaed;
    background-color: #ffffff;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.footer-sep {
    color: #d1d5db;
    font-size: 0.75rem;
}

.footer-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.78rem;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: #374151;
    text-decoration: underline;
}

.copyright {
    color: #9ca3af;
    font-size: 0.75rem;
    margin: 0;
}

/* ?? Animation ?? */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);     }
}

/* ?? Responsive ?? */
@media (max-width: 480px) {
    .public-main {
        padding: 24px 16px;
        align-items: flex-start;
    }

    .login-container {
        padding: 28px 20px;
        border-radius: 10px;
    }

    .login-title {
        font-size: 1.3rem;
    }

    .public-card-wrap {
        max-width: 100%;
    }
}
