/* --- Design Tokens --- */
:root {
    --brand-primary-dark: #123C5B;
    --brand-primary: #58879A;
    --brand-primary-hover: #466e7f;
    --brand-text: #0F3047;
    --text-muted: #64748B;
    --bg-gradient-start: #F5F7FA;
    --bg-gradient-end: #E4E9F2;
    --white: #ffffff;
}

/* --- Reset & Base Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--brand-text);
    margin: 0;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* --- Header Styles --- */
.main-header {
    width: 100%;
    background-color: var(--brand-primary-dark);
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
}

.header-content {
    /* max-width: 1200px; */
    margin: 0 auto;
    width: 95%;
    display: flex;
    align-items: center;
    padding: 0.625rem 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    color: var(--white);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    color: white;
}

.brand-name {
    font-size: 1.125rem;
    font-family: serif;
    letter-spacing: 0.025em;
}

.brand-sub {
    font-size: 0.75rem;
    font-family: serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* --- Main Layout --- */
.main-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    position: relative;
}

/* Decorative Background Blobs */
.bg-blob {
    position: absolute;
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    filter: blur(64px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.blob-1 {
    top: -5%;
    right: -5%;
    background-color: #DBEAFE;
}

.blob-2 {
    bottom: -5%;
    left: -5%;
    background-color: #E2E8F0;
}

/* --- Card Styles --- */
.login-card {
    width: 100%;
    max-width: 380px; /* Default width */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 20px 25px -5px rgba(18, 60, 91, 0.1);
}

.login-card--wide {
    max-width: 500px; /* Override for recovery form */
}

@media (min-width: 640px) {
    .login-card {
        padding: 1.75rem;
    }
}

.card-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary-dark);
    margin-bottom: 0.5rem;
}

.welcome-text {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

/* --- Form Styles --- */
.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 8px !important;
    color: var(--brand-text);
    background: #F8FAFC;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.input-field:focus {
    background: #fff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(88, 135, 154, 0.15);
}

/* --- Buttons --- */
.login-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary {
    width: -webkit-fill-available;
    background-color: var(--brand-primary);
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(88, 135, 154, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    width: 100%;
    background-color: transparent;
    color: var(--brand-primary);
    border: 2px solid var(--brand-primary);
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

.btn-secondary:hover {
    background-color: #F8FAFC;
    color: var(--brand-primary-hover);
    border-color: var(--brand-primary-hover);
}

.login-actions > .btn-primary, .login-actions > .btn-secondary {
	width: auto;
}

/* --- Footer --- */
.main-footer {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: #9CA3AF;
}

/* --- Spinner --- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

.loading .spinner {
    display: block;
}

/* --- Password Toggle Specifics --- */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    z-index: 5;
}

.password-toggle i {
    font-size: 1.2rem;
}

/* --- Card Footer Links (Login Page) --- */
.card-footer-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #F1F5F9;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.action-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.action-link:hover {
    color: var(--brand-primary);
    background: rgba(88, 135, 154, 0.05);
}

.icon-circle {
    padding: 0.75rem;
    border-radius: 50%;
    background-color: #F8FAFC;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-md {
    font-size: 1.5rem;
}
.icon-sm {
    font-size: 1.25rem;
}