/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #7A0115;
    --primary-red-dark: #730114;
    --primary-red-light: rgba(122, 1, 21, 0.1);
    --gray-light: #F3F3F3;
    --gray-normal: #46484A;
    --gray-dark: #353638;
    --gray-darker: #19191A;
    --text-primary: #19191A;
    --text-secondary: #6B7280;
    --white: #FFFFFF;
    --shadow: 0px 0px 25px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0px 10px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --success-green: #10B981;
    --error-red: #EF4444;
    --warning-yellow: #F59E0B;
    --info-blue: #3B82F6;
}

body {
    font-family: 'Inter', 'Manrope', Helvetica, sans-serif;
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Background Shapes */
.login-bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-red);
    top: -150px;
    right: -150px;
    animation: float 20s infinite ease-in-out;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--gray-normal);
    bottom: -100px;
    left: -100px;
    animation: float 25s infinite ease-in-out reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: var(--primary-red);
    top: 50%;
    left: 10%;
    animation: float 30s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Card */
.login-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(122, 1, 21, 0.1);
    position: relative;
    overflow: hidden;
}

.login-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-red-dark));
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.login-logo i {
    font-size: 48px;
    color: var(--primary-red);
    background: var(--primary-red-light);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary-red);
    font-size: 16px;
}

/* Input Fields */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 56px 14px 48px;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 15px;
    transition: var(--transition);
    background: var(--white);
    color: var(--text-primary);
    font-family: inherit;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px var(--primary-red-light);
}

.input-with-icon input::placeholder {
    color: var(--text-secondary);
}

.input-with-icon i:first-of-type {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
    font-size: 18px;
    pointer-events: none;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-light);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--gray-normal);
    cursor: pointer;
    font-size: 22px;
    transition: var(--transition);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    width: 38px;
    height: 38px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.password-toggle:hover {
    color: var(--primary-red);
    background: var(--primary-red-light);
    border-color: var(--primary-red);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 2px 6px rgba(122, 1, 21, 0.15);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle i {
    font-size: 20px;
    line-height: 1;
}

/* Password Label Row */
.password-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-password {
    font-size: 13px;
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--primary-red-dark);
    text-decoration: underline;
}

/* Input Feedback */
.input-feedback {
    font-size: 12px;
    min-height: 18px;
    padding: 0 4px;
    transition: var(--transition);
}

.input-feedback.error {
    color: var(--error-red);
}

.input-feedback.success {
    color: var(--success-green);
}

/* Remember Me */
.remember-me {
    margin: 4px 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-light);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: var(--transition);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-container input:checked+.checkmark {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.checkbox-container input:checked+.checkmark::after {
    content: '✓';
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary-red);
}

/* Login Button */
.login-btn {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
    color: var(--white);
    border: none;
    padding: 16px;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    margin-top: 8px;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(122, 1, 21, 0.3);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-btn i {
    font-size: 18px;
}

/* Button Loader */
.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading .btn-loader {
    display: block;
}

.loading .login-btn span {
    opacity: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-light);
}

.divider span {
    padding: 0 15px;
}

/* Social Login */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.social-btn {
    padding: 12px;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    background: var(--white);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-btn:hover {
    border-color: var(--primary-red);
    background: var(--primary-red-light);
    transform: translateY(-2px);
}

.social-btn.google:hover {
    border-color: #DB4437;
    background: rgba(219, 68, 55, 0.1);
}

.social-btn.microsoft:hover {
    border-color: #00A4EF;
    background: rgba(0, 164, 239, 0.1);
}

/* Sign Up Link */
.signup-link {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-light);
    font-size: 14px;
    color: var(--text-secondary);
}

.signup-link a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    margin-left: 8px;
    transition: var(--transition);
}

.signup-link a:hover {
    color: var(--primary-red-dark);
    text-decoration: underline;
}

/* Notifications */
.notification {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-green);
    color: var(--success-green);
}

.notification.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-red);
    color: var(--error-red);
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    font-size: 13px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-red);
}

/* Forgot Password Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-container {
    background: var(--white);
    border-radius: 12px;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(122, 1, 21, 0.1);
    animation: modalFadeIn 0.3s ease;
}

.modal-container.compact {
    max-width: 400px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--primary-red);
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--white);
}

.close-modal {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 60px);
    overflow-y: auto;
}

.reset-instructions {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--gray-light);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    gap: 10px;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 120px;
}

.modal-btn-cancel {
    background: var(--gray-normal);
    color: var(--white);
}

.modal-btn-cancel:hover {
    background: var(--gray-dark);
    transform: translateY(-1px);
}

.modal-btn-submit {
    background: var(--primary-red);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(122, 1, 21, 0.2);
}

.modal-btn-submit:hover {
    background: var(--primary-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(122, 1, 21, 0.3);
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        padding: 10px;
    }

    .login-card {
        padding: 30px 25px;
    }

    .login-logo i {
        font-size: 40px;
        width: 70px;
        height: 70px;
    }

    .login-logo h1 {
        font-size: 20px;
    }

    .social-login {
        grid-template-columns: 1fr;
    }

    .modal-container.compact {
        max-width: 95%;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 25px 20px;
    }

    .login-logo i {
        font-size: 36px;
        width: 60px;
        height: 60px;
    }

    .login-logo h1 {
        font-size: 18px;
    }

    .input-with-icon input {
        padding: 12px 52px 12px 44px;
    }

    .password-toggle {
        right: 6px;
        width: 36px;
        height: 36px;
        padding: 8px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}

/* Focus States for Accessibility */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Password Strength Indicator */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--gray-light);
    border-radius: 2px;
    transition: var(--transition);
}

.strength-bar.active {
    background: var(--primary-red);
}

.strength-text {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Shake Animation for Errors */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}