/* ===========================
   GENERAL STYLES & VARIABLES
   =========================== */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* ===========================
   LOGIN CONTAINER LAYOUT
   =========================== */

.login-container {
    display: flex;
    width: 95%;
    max-width: 1000px;
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   LEFT SIDE - BRANDING
   =========================== */

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -50px;
    right: -50px;
    animation: float 6s ease-in-out infinite;
}

.login-left::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -30px;
    left: -30px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(20px);
    }
}

.login-branding {
    text-align: center;
    position: relative;
    z-index: 1;
}

.brand-icon {
    font-size: 80px;
    margin-bottom: 30px;
    display: inline-block;
    animation: bounceIn 0.8s ease-out 0.2s both;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.login-branding h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -1px;
    animation: slideDown 0.6s ease-out 0.3s both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-branding p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
    animation: slideDown 0.6s ease-out 0.4s both;
}

/* ===========================
   RIGHT SIDE - LOGIN FORM
   =========================== */

.login-right {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-white);
}

.login-form {
    width: 100%;
}

.form-header {
    margin-bottom: 40px;
}

.form-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.form-subtitle {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

/* ===========================
   FORM ELEMENTS
   =========================== */

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary-color);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-dark);
    background: var(--bg-white);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input::placeholder {
    color: #d1d5db;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group.focused .form-input {
    border-color: var(--primary-color);
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* ===========================
   ALERTS & ERROR MESSAGES
   =========================== */

.alert-error {
    display: flex;
    align-items: center;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.alert-error i {
    margin-right: 10px;
    font-size: 16px;
}

/* ===========================
   BUTTONS
   =========================== */

.btn-login {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1c3a8a 100%);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    font-size: 14px;
}

.btn-forgot {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    padding: 0;
    transition: color 0.2s ease;
    font-weight: 500;
}

.btn-forgot:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.btn-send {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: var(--bg-white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* ===========================
   FORM FOOTER
   =========================== */

.form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-footer p {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

.link-signup {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.link-signup:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.forgot-group {
    margin-bottom: 20px;
    text-align: right;
}

/* ===========================
   POPUP/MODAL STYLES
   =========================== */

.popup {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.popup-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.popup-content {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: 16px;
    width: 95%;
    max-width: 400px;
    position: relative;
    z-index: 1001;
    box-shadow: var(--shadow-xl);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.forgot-form {
    width: 100%;
}

.forgot-form .form-header {
    margin-bottom: 30px;
}

.forgot-form .form-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.forgot-form .form-header p {
    color: var(--text-light);
    font-size: 13px;
}

.form-message {
    display: none;
    padding: 12px 16px;
    background-color: #dbeafe;
    border-left: 4px solid var(--primary-color);
    color: var(--text-dark);
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.form-message.show {
    display: block;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        max-width: 100%;
        border-radius: 0;
    }

    .login-left {
        padding: 40px 20px;
        min-height: 250px;
    }

    .login-left::before {
        width: 150px;
        height: 150px;
        top: -40px;
        right: -40px;
    }

    .login-left::after {
        width: 100px;
        height: 100px;
        bottom: -20px;
        left: -20px;
    }

    .login-branding h1 {
        font-size: 28px;
    }

    .login-branding p {
        font-size: 14px;
    }

    .brand-icon {
        font-size: 60px;
        margin-bottom: 20px;
    }

    .login-right {
        padding: 40px 25px;
    }

    .form-header h2 {
        font-size: 24px;
    }

    .popup-content {
        width: 90%;
        padding: 30px;
    }

    html, body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        align-items: flex-start;
        padding-top: 20px;
    }
}

@media (max-width: 480px) {
    .login-right {
        padding: 30px 20px;
    }

    .form-header h2 {
        font-size: 20px;
    }

    .form-header {
        margin-bottom: 30px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn-login {
        padding: 12px 16px;
        font-size: 14px;
    }

    .popup-content {
        width: 95%;
        padding: 25px;
    }

    .form-subtitle {
        font-size: 13px;
    }
}

/* ===========================
   UTILITY STYLES
   =========================== */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    box-shadow: 0 0 0 30px white inset !important;
}

input:-webkit-autofill {
    -webkit-text-fill-color: var(--text-dark) !important;
}
