/* Modern Login CSS - Orange Theme with Error Popup */
:root {
    --primary-orange: #ff6b35;
    --orange-light: #ff8c65;
    --orange-dark: #e55a2b;
    --orange-gradient: linear-gradient(135deg, #ff6b35 0%, #ff8c65 100%);
    --dark-navy: #1a1d29;
    --light-gray: #f8f9fa;
    --medium-gray: #6c757d;
    --white: #ffffff;
    --error-red: #e74c3c;
    --shadow-light: 0 2px 10px rgba(255, 107, 53, 0.1);
    --shadow-medium: 0 8px 25px rgba(255, 107, 53, 0.15);
    --shadow-heavy: 0 15px 40px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --border-radius-small: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Decorations */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: var(--orange-gradient);
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: -50px;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: -75px;
    animation-delay: 2s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Popup Styles */
.error-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.error-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.error-popup {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-heavy);
    transform: scale(0.7) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.error-popup-overlay.show .error-popup {
    transform: scale(1) translateY(0);
}

.error-icon {
    width: 60px;
    height: 60px;
    background: var(--error-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: shake 0.5s ease-in-out;
}

.error-icon i {
    color: var(--white);
    font-size: 24px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--error-red);
    margin-bottom: 12px;
}

.error-message {
    color: var(--medium-gray);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.error-close-btn {
    background: var(--error-red);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-small);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 80px;
}

.error-close-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.error-close-btn:active {
    transform: translateY(0);
}

/* App Capsule */
.app-capsule {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

/* Login Container */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

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

.logo-container {
    margin-bottom: 24px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    background: var(--white);
    padding: 12px;
    animation: fadeInUp 0.8s ease;
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.welcome-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* Login Form Container */
.login-form-container {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px 32px;
    box-shadow: var(--shadow-heavy);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease 0.6s both;
}

.login-form {
    width: 100%;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.input-container {
    position: relative;
    transition: var(--transition);
}

.input-container.focused {
    transform: translateY(-2px);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--medium-gray);
    font-size: 18px;
    transition: var(--transition);
}

.input-container.focused .input-icon {
    color: var(--primary-orange);
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 52px;
    border: 2px solid #c4cfda;
    border-radius: var(--border-radius-small);
    font-size: 16px;
    font-weight: 400;
    background: var(--medium-gray);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-orange);
    background: var(--medium-gray);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.form-input::placeholder {
    color: var(--medium-gray);
    font-weight: 400;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--medium-gray);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary-orange);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--medium-gray);
    user-select: none;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: var(--transition);
}

.remember-me input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
}

.remember-me input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
}

.forgot-link {
    font-size: 14px;
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--orange-dark);
    text-decoration: underline;
}

/* Login Button */
.login-btn {
    width: 100%;
    background: var(--orange-gradient);
    border: none;
    border-radius: var(--border-radius-small);
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Login Button */
.login-btn {
    width: 100%;
    background: var(--orange-gradient);
    border: none;
    border-radius: var(--border-radius-small);
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-icon {
    margin-left: 8px;
    transition: var(--transition);
}

.login-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Divider */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.divider span {
    background: var(--white);
    padding: 0 16px;
    color: var(--medium-gray);
    font-size: 14px;
    position: relative;
}

/* Register Section */
.register-section {
    text-align: center;
}

.register-text {
    color: var(--medium-gray);
    font-size: 14px;
    margin-bottom: 8px;
}

.register-link {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.register-link:hover {
    color: var(--orange-dark);
    text-decoration: underline;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 40px;
}

.login-footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .app-capsule {
        padding: 16px;
    }

    .login-form-container {
        padding: 32px 24px;
    }

    .app-title {
        font-size: 24px;
    }

    .welcome-text {
        font-size: 14px;
    }

    .logo {
        width: 70px;
        height: 70px;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

@media (max-width: 360px) {
    .login-form-container {
        padding: 24px 16px;
    }

    .app-title {
        font-size: 22px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    }

    .login-form-container {
        background: rgba(26, 32, 44, 0.9);
        color: var(--white);
    }

    .form-input {
        background: #2d3748;
        border-color: #4a5568;
        color: var(--white);
    }

    .form-input::placeholder {
        color: #a0aec0;
    }

    .register-text {
        color: #a0aec0;
    }

    .divider::before {
        background: #4a5568;
    }

    .divider span {
        background: rgba(26, 32, 44, 0.9);
        color: #a0aec0;
    }
}
