/* ===== Login Page - Self-contained (no Bootstrap) ===== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Full-screen background ---- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: url('../images/bg.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(22, 44, 91, 0.88) 0%, rgba(3, 69, 43, 0.88) 100%);
    z-index: 0;
}

/* ---- Card ---- */
.login-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 12px 28px;
    width: 100%;
    max-width: 420px;
    border-top: 4px solid #162C5B;
}

/* ---- Header ---- */
.login-header {
    text-align: center;
    margin-bottom: 0;
}

.login-logo {
    display: block;
    margin: 15px auto;
    width: 100%;
    max-width: 200px;
    height: auto;
}

.login-powered a {
    color: #374151;
    text-decoration: none;
}

.login-powered a:hover {
    text-decoration: underline;
    color: #162C5B;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #162C5B;
    line-height: 1.3;
}

.login-header p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

/* ---- Alert boxes ---- */
.login-alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    line-height: 1.5;
    border-left: 4px solid;
}

.login-alert-danger {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.login-alert-success {
    background-color: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.login-alert-info {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* ---- Form fields ---- */
.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
}

.login-input-wrap input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.login-input-wrap input::placeholder {
    color: #9ca3af;
}

.login-input-wrap input:focus {
    border-color: #162C5B;
    box-shadow: 0 0 0 3px rgba(22, 44, 91, 0.15);
}

/* Password toggle */
.login-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.login-toggle:hover {
    color: #374151;
    background: #f3f4f6;
}

/* ---- Submit button ---- */
.login-submit {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: #162C5B;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.login-submit:hover:not(:disabled) {
    background: #1e3a6e;
}

.login-submit:active:not(:disabled) {
    background: #12234a;
}

.login-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner */
.login-spinner {
    width: 20px;
    height: 20px;
    animation: login-spin 0.8s linear infinite;
    color: #fff;
}

@keyframes login-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* ---- Footer links ---- */
.login-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.login-footer a {
    font-size: 0.875rem;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
    color: #162C5B;
}

/* ---- Powered by ---- */
.login-powered {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.8125rem;
    color: #6b7280;
}

.login-powered strong {
    color: #374151;
}

/* ---- Demo credentials ---- */
.login-creds {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #0c4a6e;
}

.login-creds-title {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    color: #075985;
}

.login-creds-row span {
    font-weight: 600;
}

/* ---- Responsive tweaks ---- */
@media (max-width: 480px) {
    .login-card {
        padding: 24px 20px;
    }
}
