@import url('../variables.css');

/* Login Page Styles - Mobile First Approach */

/* Global Styles - Updated to work with main layout */
body {
    margin: 0;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

*::-webkit-scrollbar {
    display: none;
}

html {
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
    margin: 0;
}

/* Apply box-sizing globally */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Auth Page Layout */
.auth-page {
    flex: 1 0 auto; /* Allow this to grow and push footer down */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: calc(100vh - 160px);
}

.auth-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
}

/* Form Section */
.auth-form-section {
    padding: 40px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-form {
    width: 100%;
    max-width: 400px;
}

/* Auth Header */
/* nav.css declares a global `.logo { display: flex; align-items: center; }`
   for the navbar; this higher-specificity rule restores a centered, stacked
   layout (image above title above subtitle) inside the auth forms. */
.auth-header .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .logo img {
    display: block;
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
}

.auth-header h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--primary-color);
    text-align: center;
}

.auth-header p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

/* Error Messages */
.error-message {
    background: #ffeaea;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.error-message i {
    color: var(--error-color);
    margin-top: 2px;
}

.error-message span {
    color: var(--error-color);
    font-size: 0.9rem;
}

.success-message {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.success-message i {
    color: #2e7d32;
    margin-top: 2px;
}

.success-message span {
    color: #2e7d32;
    font-size: 0.9rem;
}

.resend-form {
    margin-top: 1rem;
    text-align: center;
}

.auth-footer-link {
    text-align: center;
    margin-top: 1rem;
}

.auth-footer-link a {
    color: var(--secondary-color);
    text-decoration: none;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* Social Login */
.social-login {
    margin-bottom: 25px;
}

.btn-discord {
    width: 100%;
    background: #5865F2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
}

.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.divider {
    margin: 20px 0;
    text-align: center;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: #fff;
    padding: 0 15px;
    color: #666;
    font-size: 0.9rem;
    position: relative;
}

/* Form Styles */
.login-form .form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 12px;
    color: #999;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 45px 12px 40px; /* Added right padding for toggle button */
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
    background: #fff;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(195, 155, 85, 0.1);
}

/* Specific styling for password inputs with toggle button */
input[type="password"] {
    padding-right: 45px !important;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.toggle-password:hover {
    color: var(--secondary-color);
    background-color: rgba(195, 155, 85, 0.1);
}

.toggle-password i {
    font-size: 0.9rem;
}

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

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    margin: 0;
}

.forgot-password {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--secondary-color);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #b8944d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(195, 155, 85, 0.3);
}

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

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.auth-footer a:not(.btn) {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-footer a:not(.btn):hover {
    color: var(--primary-color);
}

.auth-footer a.btn,
.auth-footer a.btn:hover {
    color: #fff;
}

/* Info Section */
.auth-info-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a1a1a 100%);
    color: #fff;
    padding: 40px 30px;
    display: none;
}

.info-content {
    max-width: 400px;
    margin: 0 auto;
}

.feature-list h2 {
    margin: 0 0 30px;
    font-size: 1.6rem;
    font-weight: 600;
}

.feature-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 1.1rem;
    color: #fff;
}

.feature-text h3 {
    margin: 0 0 5px;
    font-size: 1rem;
    font-weight: 600;
}

.feature-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (min-width: 768px) {
    .auth-page {
        padding: 40px;
    }
    
    .auth-wrapper {
        grid-template-columns: 1fr 1fr;
    }
    
    .auth-form-section {
        padding: 60px 50px;
    }
    
    .auth-info-section {
        display: block;
    }
    
    .auth-header h1 {
        font-size: 2rem;
    }
    
    .form-options {
        font-size: 0.85rem;
    }
}

@media (min-width: 1024px) {
    .auth-form-section {
        padding: 80px 60px;
    }
    
    .auth-info-section {
        padding: 80px 60px;
    }
}

/* Animation for form elements */
.auth-form {
    animation: slideInUp 0.6s ease-out;
}

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

/* Focus animations */
.input-wrapper input:focus + .toggle-password {
    color: var(--secondary-color);
}

/* Loading state for button */
.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .loading-spinner {
    display: block;
}
