:root {
    --header-bg:  #2a3540;
    --footer-bg:  #222a33;
    --link-red:   #c8102e;
    --btn-active: #b3394c;
    --btn-hover:  #922b3b;
    --btn-gray:   #d1d5d8;
    --text-dark:  #333333;
    --border-col: #a0a5aa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #fcfcfc;
    color: var(--text-dark);
}

.top-header {
    background-color: var(--header-bg);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
}
.top-header a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-left: 20px;
}
.top-header a:hover { text-decoration: underline; }
.top-header svg {
    margin-right: 5px;
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.main-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background-color: #ffffff;
}

.login-container,
.otp-container {
    width: 100%;
    max-width: 420px;
    border: 1px solid #e0e0e0;
    padding: 40px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.login-container { text-align: center; }

.logo-svg {
    display: block;
    width: 220px;
    height: auto;
    margin: 0 auto 25px;
}

.login-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 30px;
}
.login-title svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.otp-title {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 14px;
}
.otp-title svg {
    width: 22px;
    height: 22px;
    margin-right: 10px;
    flex-shrink: 0;
}

.otp-desc {
    font-size: 14px;
    color: #444;
    line-height: 1.55;
    margin-bottom: 28px;
}
.otp-desc strong { color: var(--text-dark); }

.otp-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 22px;
}
.otp-hint span {
    font-weight: bold;
    color: var(--text-dark);
}

.alert {
    padding: 15px;
    margin-bottom: 25px;
    font-size: 15px;
    font-weight: bold;
    text-align: left;
    display: flex;
    align-items: center;
}
.alert-error {
    background-color: #ffffff;
    border: 2px solid #b60000;
    color: #b60000;
}
.alert-icon {
    margin-right: 15px;
    width: 30px;
    height: 30px;
    fill: #b60000;
    flex-shrink: 0;
}
.alert-success {
    background-color: #def7ec;
    border: 1px solid #84e1bc;
    color: #03543f;
}

.form-group {
    position: relative;
    margin-bottom: 25px;
    text-align: left;
}
.form-group input {
    width: 100%;
    padding: 16px 14px;
    border: 1px solid #555;
    font-size: 16px;
    outline: none;
    border-radius: 2px;
    background-color: transparent;
    transition: border-color 0.2s;
}
.form-group input:focus {
    border-color: #005a8b;
    border-width: 2px;
    padding: 15px 13px;
}
.otp-container .form-group input[type="text"] {
    font-size: 18px;
    letter-spacing: 4px;
    text-align: center;
}
.otp-container .form-group input[type="text"]:focus {
    padding: 16px 14px;
}
.form-group input.has-error { border-color: var(--link-red); }

.floating-label-group label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    padding: 0 4px;
    color: #555;
    font-size: 16px;
    transition: 0.2s ease all;
    pointer-events: none;
}
.floating-label-group input:focus ~ label,
.floating-label-group input:not(:placeholder-shown) ~ label {
    top: 0;
    font-size: 13px;
    color: #555;
    font-style: normal;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: #005a8b;
}

.field-error {
    color: var(--link-red);
    font-size: 15px;
    margin-top: 5px;
}

.method-option {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.method-option:hover {
    border-color: #888;
    background-color: #fafafa;
}
.method-option input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--link-red);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}
.method-option.selected {
    border-color: var(--link-red);
    background-color: #fff5f6;
}
.method-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-dark);
}
.method-sublabel {
    font-size: 13px;
    color: #666;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background-color: var(--btn-gray);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 25px;
    transition: background-color 0.3s;
    border-radius: 2px;
}
.btn-login:hover   { background-color: #b0b5b8; }
.btn-login.active  { background-color: var(--btn-active); }
.btn-login.active:hover { background-color: var(--btn-hover); }

.btn-primary {
    display: block;
    width: 100%;
    padding: 16px;
    background-color: var(--btn-active);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 2px;
    margin-bottom: 20px;
    text-align: center;
}
.btn-primary:hover { background-color: var(--btn-hover); }

.links-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    font-size: 15px;
    font-weight: 500;
}
.links-row a, .register-text a {
    color: var(--link-red);
    text-decoration: none;
}
.links-row a:hover, .register-text a:hover { text-decoration: underline; }
.register-text { font-size: 15px; color: #333; }
.register-text a { font-weight: bold; }

.back-link {
    display: block;
    text-align: center;
    font-size: 15px;
    color: var(--link-red);
    text-decoration: none;
    font-weight: 500;
}
.back-link:hover { text-decoration: underline; }

.resend-row {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin-top: 10px;
    margin-bottom: 20px;
}
.resend-row a {
    color: var(--link-red);
    text-decoration: none;
    font-weight: 600;
}
.resend-row a:hover { text-decoration: underline; }

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(34, 42, 51, 0.93);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
}
.loading-overlay.show { display: flex; }

.spinner {
    width: 52px;
    height: 52px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #c8102e;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(3, end) infinite;
}
@keyframes dots {
    0%   { content: ''; }
    33%  { content: '.'; }
    66%  { content: '..'; }
    100% { content: '...'; }
}

.footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 40px;
    font-size: 13px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.footer-top {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
@media (max-width: 768px) {
    .footer-top { flex-direction: column; }
}
.brand-statement {
    color: white;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
    width: 200px;
    font-family: Georgia, serif;
}
.brand-statement span { display: block; }
.footer-content { flex-grow: 1; }
.footer-links { margin-bottom: 15px; }
.footer-links a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    text-transform: uppercase;
}
.footer-links a:hover { text-decoration: underline; }
.footer-text p { margin-bottom: 10px; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #333;
    padding-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
}
.footer-bottom a { color: white; text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; }
