/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Login Container */
.login-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 60px 40px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    width: 80px;
    height: 80px;
    fill: #667eea;
    margin-bottom: 15px;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.logo-section h1 {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    letter-spacing: -0.5px;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Password Wrapper */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-input {
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #667eea;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Checkbox */
.form-group.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
}

/* Login Button */
.login-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: 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;
}

.login-button:hover {
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

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

/* Forgot Password */
.forgot-password {
    text-align: center;
    margin-top: 15px;
}

.forgot-password a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Alternative Login Options */
.alternative-logins {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    margin-top: 30px;
}

.sso-button {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.sso-button:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.sso-button.github:hover {
    border-color: #24292e;
    background: #f6f8fa;
}

.sso-button.google:hover {
    border-color: #4285f4;
    background: #f9f9f9;
}

/* Footer */
.login-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    font-size: 13px;
    color: #999;
}

.login-footer p {
    margin-bottom: 12px;
    font-weight: 500;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.divider {
    color: #ddd;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 30%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 500px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    color: #555;
    font-size: 15px;
    line-height: 1.6;
}

.modal-body h3 {
    margin: 20px 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.modal-body p {
    margin: 10px 0;
    color: #666;
}

.modal-body ul {
    margin: 10px 0 10px 20px;
    padding-left: 0;
}

.modal-body ul li {
    margin: 8px 0;
    color: #666;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f5f5f5;
}

.modal-button, .modal-button-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-button:hover {
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.modal-button:active {
    transform: translateY(0);
}

.modal-button-secondary {
    background: #e0e0e0;
    color: #333;
}

.modal-button-secondary:hover {
    background: #d0d0d0;
}

#forgot-form .form-group {
    margin-bottom: 20px;
}

.forgot-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.forgot-error.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 600px) {
    .login-box {
        padding: 40px 25px;
        border-radius: 10px;
    }

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

    .logo-section h1 {
        font-size: 24px;
    }

    .login-button {
        padding: 11px 18px;
        font-size: 14px;
    }

    .form-input {
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .login-box {
        padding: 30px 15px;
    }

    .logo-section {
        margin-bottom: 30px;
    }

    .form-label {
        font-size: 12px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    html, body {
        background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    }

    .login-box {
        background: #1f2937;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    }

    .logo-section h1 {
        color: #f0f0f0;
    }

    .form-label {
        color: #d1d5db;
    }

    .form-input {
        background-color: #111827;
        border-color: #374151;
        color: #e5e7eb;
    }

    .form-input:focus {
        border-color: #818cf8;
        background-color: #1f2937;
        box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
    }

    .checkbox-label {
        color: #d1d5db;
    }

    .sso-button {
        background: #2d3748;
        border-color: #4b5563;
        color: #e5e7eb;
    }

    .sso-button:hover {
        background: #3a4556;
    }

    .login-footer {
        border-top-color: #374151;
        color: #6b7280;
    }

    .modal {
        background: rgba(0, 0, 0, 0.7);
    }

    .modal-content {
        background: #1f2937;
        border-color: #374151;
    }

    .modal-header {
        border-bottom-color: #374151;
    }

    .modal-header h2 {
        color: #f0f0f0;
    }

    .modal-close {
        color: #9ca3af;
    }

    .modal-close:hover {
        color: #e5e7eb;
    }

    .modal-body p, .modal-body h3 {
        color: #d1d5db;
    }

    .modal-body ul li {
        color: #d1d5db;
    }

    .modal-footer {
        background: #111827;
        border-top-color: #374151;
    }

    .modal-button {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }

    .modal-button:hover {
        box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    }

    .modal-button-secondary {
        background: #374151;
        color: #e5e7eb;
    }

    .modal-button-secondary:hover {
        background: #4b5563;
    }

    .forgot-error {
        color: #ef4444;
    }

    #forgot-email {
        border-color: #374151;
    }

    #forgot-email:focus {
        border-color: #818cf8;
    }
}
