@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

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

html, body {
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
nav {
    padding: 20px 0;
}

.nav-logo {
    display: flex;
    color: #333;
}

.nav-logo img {
    margin-right: 5px;
}

/* Main container */
.main-container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 40px;
    border-radius: 24px;
    background: white;
}

.split-container {
    display: flex;
    gap: 60px;
    align-items: center;
}

.info-section {
    flex: 1;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.auth-section {
    flex: 1;
    padding: 40px;
    border-left: 1px solid #eee;
}

/* Typography */
.auth-title {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    color: #333;
}

.auth-title i {
    color: #5271ff;
    font-size: 1.8rem;
    margin-left: 8px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 35px;
    line-height: 1.5;
}

/* Form elements */
.auth-form {
    display: block;
    opacity: 1;
}

.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    height: 56px;
    padding: 20px 16px 8px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: white;
}

.form-control::placeholder {
    color: transparent;
}

.form-control:focus {
    outline: none;
    border-color: #5271ff;
    box-shadow: 0 0 0 3px rgba(82,113,255,0.1);
}

.form-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #666;
    transition: all 0.2s ease;
    pointer-events: none;
    background: white;
    padding: 0 4px;
}

.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
    top: 8px;
    transform: translateY(0);
    font-size: 12px;
    color: #0862ff;
}

/* Button styles */
.auth-button {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 12px;
    background: #0862ff;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.auth-button:hover:not(:disabled) {
    background: #0862ff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(82,113,255,0.3);
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.reset-btn {
    background: #0862ff;
}

.btn-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.spin {
    animation: spin 1s linear infinite;
}

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

/* Links and terms */
.terms {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 30px;
}

.terms a {
    color: #5271ff;
    text-decoration: none;
    font-weight: 500;
}

.terms a:hover {
    text-decoration: underline;
}

/* Rate limit info */
.rate-limit-info {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 3px solid #5271ff;
}

.rate-limit-info small {
    color: #666;
    font-size: 13px;
}

.rate-limit-info i {
    color: #5271ff;
    margin-right: 6px;
}

/* Toast notifications */
.simple-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background-color: #fff;
    color: #333;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 400px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px) translateX(20px);
    transition: all 0.3s ease;
    font-size: 14px;
}

.simple-toast.show {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.simple-toast.success {
    border-left: 4px solid #4caf50;
    background: white;
}

.simple-toast.error {
    border-left: 4px solid #f44336;
    background: #fff8f8;
}

.simple-toast.warning {
    border-left: 4px solid #ff9800;
    background: #fffaf0;
}

.simple-toast.info {
    border-left: 4px solid #2196f3;
    background: #f0f8ff;
}

.toast-message {
    margin-right: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #666;
}

/* Success state */
.form-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 36px;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.success-message {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 30px;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-container {
        margin: 0;
        padding: 20px;
        box-shadow: none;
        border-radius: 0;
        min-height: 100vh;
    }

    .split-container {
        flex-direction: column-reverse;
        gap: 20px;
    }

    .auth-section {
        border-left: none;
        padding: 20px 0;
    }

    .info-section {
        padding: 20px 0;
    }

    .auth-title {
        font-size: 1.8rem;
        text-align: center;
    }

    .auth-subtitle {
        text-align: center;
    }

    .simple-toast {
        left: 20px;
        right: 20px;
        max-width: none;
        transform: translateY(-20px);
    }

    .simple-toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 15px;
    }

    .auth-title {
        font-size: 1.6rem;
    }

    .form-control {
        height: 52px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .auth-button {
        height: 52px;
    }
}

/* Loading state animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Password strength and requirements styles */
.password-strength {
    margin-top: 8px;
    font-size: 12px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.password-match {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
}

.password-requirements {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 3px solid #5271ff;
}

.requirements-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.requirements-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.requirements-list li {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.requirements-list li i {
    margin-right: 8px;
    font-size: 14px;
}

.requirements-list li.valid {
    color: #4caf50;
}

.requirements-list li.invalid {
    color: #999;
}

.requirements-list li.valid i {
    color: #4caf50;
}

.requirements-list li.invalid i {
    color: #ccc;
}

/* Password toggle button */
.form-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    z-index: 2;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #5271ff;
}

/* Form with password toggle adjustments */
.form-control:not(:placeholder-shown) + .form-label + .password-toggle {
    top: calc(50% + 6px);
}

.form-control:focus + .form-label + .password-toggle {
    top: calc(50% + 6px);
}

/* Submit button valid state */
.auth-button.valid {
    background: #4caf50;
}

.auth-button.valid:hover:not(:disabled) {
    background: #45a049;
}

/* Error section styles */
.error-section {
    text-align: center;
    padding: 40px 20px;
}

.error-message {
    color: #f44336;
    font-weight: 500;
    margin-bottom: 30px;
    padding: 15px;
    background: #fff5f5;
    border-radius: 8px;
    border-left: 4px solid #f44336;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.secondary-btn {
    background: #f8f9fa !important;
    color: #666 !important;
    border: 1px solid #e0e0e0 !important;
}

.secondary-btn:hover {
    background: #e9ecef !important;
    color: #333 !important;
}

.secondary-btn i {
    color: #666 !important;
}

/* Success state for reset password */
.success-icon i.bi-check-shield {
    font-size: 36px;
}

/* Additional responsive styles */
@media (max-width: 768px) {
    .password-requirements {
        margin: 15px 0;
        padding: 12px;
    }

    .requirements-list li {
        font-size: 11px;
    }

    .error-actions {
        gap: 10px;
    }

    .auth-button {
        font-size: 15px;
    }
}

/* Password Strength Bar */
.password-strength-bar {
    width: 100%;
    height: 4px;
    background-color: none;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 15px;
    margin-top: 8px;
}

.strength-progress {
    height: 100%;
    width: 0%;
    background-color: #e0e0e0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Password Match Indicator */
.password-match {
    margin-top: 8px;
    margin-bottom: 15px;
    font-size: 12px;
    font-weight: 500;
}

.match-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.match-indicator i {
    font-size: 14px;
}