/* 
 * Haki App - Login Pages Stylesheet
 * Professional login interface with system primary colors
 */

:root {
    --primary-color: rgb(2, 5, 29);
    --primary-light: #6f74dd;
    --primary-dark: #00227b;
    --accent-color: #4f46e5;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--primary-light) 100%);
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bg-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.bg-particle:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-delay: 0s;
}

.bg-particle:nth-child(2) {
    width: 60px;
    height: 60px;
    left: 20%;
    animation-delay: 2s;
}

.bg-particle:nth-child(3) {
    width: 100px;
    height: 100px;
    left: 60%;
    animation-delay: 4s;
}

.bg-particle:nth-child(4) {
    width: 70px;
    height: 70px;
    left: 80%;
    animation-delay: 6s;
}

.bg-particle:nth-child(5) {
    width: 90px;
    height: 90px;
    left: 40%;
    animation-delay: 8s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 50px 40px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Section */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 25px;
}

.portal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(2, 5, 29, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.portal-icon i {
    font-size: 2.5rem;
    color: white;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(2, 5, 29, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(2, 5, 29, 0.4);
    }
}

.login-header h2 {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 400;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.875rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-light);
    font-size: 1.1rem;
    z-index: 5;
    transition: all 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-light);
    color: var(--text-dark);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(111, 116, 221, 0.1);
}

.form-control:focus~.input-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    z-index: 5;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 4px;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Button Styles */
.btn-login {
    width: 100%;
    padding: 16px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
    font-family: inherit;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(2, 5, 29, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    margin-right: 8px;
}

/* Alert Styles */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: none;
    animation: slideDown 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert i {
    font-size: 1.2rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 30px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 15px;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Link Section */
.link-section {
    text-align: center;
    margin-top: 25px;
}

.link-section p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.link-section a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.link-section a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: width 0.3s ease;
}

.link-section a:hover::after {
    width: 100%;
}

.link-section a:hover {
    color: var(--primary-color);
}

/* Security Notice */
.security-notice {
    margin-top: 30px;
    padding: 16px;
    text-align: center;
    background: linear-gradient(135deg, rgba(111, 116, 221, 0.1), rgba(2, 5, 29, 0.05));
    border-radius: 12px;
    border-left: 4px solid var(--primary-light);
}

.security-notice p {
    color: var(--text-dark);
    font-size: 0.85rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.security-notice i {
    color: var(--primary-light);
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 576px) {
    body {
        padding: 20px 15px;
    }

    .login-container {
        padding: 40px 30px;
    }

    .login-header h2 {
        font-size: 1.75rem;
    }

    .portal-icon {
        width: 70px;
        height: 70px;
    }

    .portal-icon i {
        font-size: 2rem;
    }
}

/* Loading State */
.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}