/* ============================================
   ZeroTrust Portal Styles
   ============================================ */

:root {
    --portal-primary: #1a73e8;
    --portal-primary-dark: #1557b0;
    --portal-primary-light: #4a90e2;
    --portal-bg-start: #1e3c72;
    --portal-bg-end: #2a5298;
    --portal-success: #34a853;
    --portal-warning: #fbbc04;
    --portal-danger: #ea4335;
    --portal-text: #333333;
    --portal-text-light: #666666;
    --portal-border: #e0e0e0;
    --portal-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ---- Background ---- */
.portal-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--portal-bg-start) 0%, var(--portal-bg-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ---- Card ---- */
.portal-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--portal-card-shadow);
    padding: 40px;
    width: 100%;
    max-width: 460px;
    animation: fadeIn 0.5s ease-out;
}

.portal-card-wide {
    max-width: 900px;
}

/* ---- Logo ---- */
.portal-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--portal-bg-start), var(--portal-bg-end));
    border-radius: 20px;
    color: #ffffff;
    font-size: 36px;
}

.portal-logo i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ---- Title ---- */
.portal-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--portal-text);
    margin-bottom: 8px;
}

.portal-subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--portal-text-light);
    margin-bottom: 32px;
}

/* ---- Buttons ---- */
.portal-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background: var(--portal-primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
}

.portal-btn-primary:hover {
    background: var(--portal-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.portal-btn-primary:active {
    transform: translateY(0);
}

.portal-btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.portal-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--portal-primary);
    border: 2px solid var(--portal-primary);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
}

.portal-btn-secondary:hover {
    background: rgba(26, 115, 232, 0.08);
    color: var(--portal-primary);
    text-decoration: none;
}

/* ---- Inputs ---- */
.portal-input {
    position: relative;
    margin-bottom: 24px;
}

.portal-input input {
    width: 100%;
    padding: 16px 16px 8px;
    border: 2px solid var(--portal-border);
    border-radius: 10px;
    font-size: 16px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    outline: none;
}

.portal-input input:focus {
    border-color: var(--portal-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.portal-input label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999999;
    pointer-events: none;
    transition: all 0.3s ease;
}

.portal-input input:focus ~ label,
.portal-input input:not(:placeholder-shown) ~ label {
    top: 8px;
    transform: translateY(0);
    font-size: 11px;
    color: var(--portal-primary);
    font-weight: 600;
}

/* ---- OTP Input ---- */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 24px 0;
}

.otp-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--portal-border);
    border-radius: 10px;
    background: #f8f9fa;
    outline: none;
    transition: all 0.3s ease;
    color: var(--portal-text);
}

.otp-input:focus {
    border-color: var(--portal-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.otp-input.filled {
    border-color: var(--portal-success);
    background: #f0fdf4;
}

.otp-input.error {
    border-color: var(--portal-danger);
    background: #fef2f2;
}

/* ---- System Card ---- */
.system-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--portal-border);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--portal-text);
    display: block;
}

.system-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--portal-primary-light);
    color: var(--portal-text);
    text-decoration: none;
}

.system-card:active {
    transform: translateY(-2px);
}

.system-card .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: #ffffff;
}

.system-card .card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.system-card .card-desc {
    font-size: 13px;
    color: var(--portal-text-light);
    margin-bottom: 12px;
}

.system-card .card-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--portal-success);
    font-weight: 600;
}

/* ---- MFA Badge ---- */
.mfa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(251, 188, 4, 0.15);
    color: #b8860b;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.mfa-badge i {
    font-size: 10px;
}

/* ---- Access Log Table ---- */
.access-log-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.access-log-table thead th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--portal-text-light);
    border-bottom: 2px solid var(--portal-border);
    font-size: 13px;
    white-space: nowrap;
}

.access-log-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--portal-text);
}

.access-log-table tbody tr:hover {
    background: #f8f9ff;
}

.access-log-table .status-success {
    color: var(--portal-success);
    font-weight: 600;
}

.access-log-table .status-fail {
    color: var(--portal-danger);
    font-weight: 600;
}

/* ---- Shake Animation ---- */
.shake-animation {
    animation: shake 0.5s ease-in-out;
}

/* ---- Alert Messages ---- */
.portal-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.portal-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.portal-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ---- Divider ---- */
.portal-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #999999;
    font-size: 13px;
}

.portal-divider::before,
.portal-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--portal-border);
}

.portal-divider::before {
    margin-right: 12px;
}

.portal-divider::after {
    margin-left: 12px;
}

/* ---- Keyframes ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .portal-card {
        padding: 24px;
        border-radius: 12px;
    }

    .portal-logo {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }

    .otp-input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }

    .system-card .card-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}
