/* ============================================
   PLAYMATES - Shared CSS for All Pages
   ============================================ */

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

:root {
    --primary-color: #006f4a;
    --primary-dark: #005a3c;
    --secondary-color: #333;
    --background-color: #f5f1eb;
    --surface-color: #fff;
    --border-color: #e0ddd6;
    --text-primary: #333;
    --text-secondary: #666;
    --error-color: #ff4444;
    --warning-color: #ffaa00;
    --success-color: #00c851;
    --info-color: #cce7ff;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 32px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.logo-link {
    text-decoration: none;
    color: inherit;
}

.back-home {
    background: transparent;
    border: 2px solid var(--secondary-color);
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 4px;
}

.back-home:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* Auth Container (For Login, Signup, Forgot Password) */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.auth-container {
    width: 100%;
    max-width: 500px;
    background: var(--background-color);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeInUp 0.5s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* Form Styles */
.auth-form {
    display: grid;
    gap: 20px;
}

.form-group {
    position: relative;
}

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 111, 74, 0.1);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0;
}

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

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.remember-me input {
    width: auto;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.forgot-password:hover {
    text-decoration: underline;
}

.submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
    padding: 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-top: 10px;
}

.submit-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background: #cccccc;
    border-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

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

/* Password Strength */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak { background: var(--error-color); width: 25%; }
.strength-fair { background: var(--warning-color); width: 50%; }
.strength-good { background: var(--success-color); width: 75%; }
.strength-strong { background: var(--primary-color); width: 100%; }

.password-strength-text {
    font-size: 0.8rem;
    margin-top: 5px;
    color: var(--text-secondary);
}

/* Terms Checkbox */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 15px 0;
}

.terms-checkbox input {
    margin-top: 3px;
}

.terms-checkbox label {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.terms-checkbox a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

/* Verification Code Styles */
.verification-container {
    display: none;
}

.verification-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 30px 0;
}

.verification-input {
    width: 55px;
    height: 65px;
    text-align: center;
    font-size: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    transition: all 0.3s ease;
}

.verification-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 111, 74, 0.1);
}

.verification-input.filled {
    border-color: var(--primary-color);
    background: #f0f9f5;
}

.verification-hint {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 15px;
}

.resend-code {
    text-align: center;
    margin-top: 15px;
}

.resend-code a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.resend-code a:hover {
    text-decoration: underline;
}

/* Message Styles */
.form-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.form-message.info {
    background: var(--info-color);
    color: #004085;
    border: 1px solid #b3d7ff;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Back to Login Link */
.back-to-login {
    text-align: center;
    margin-top: 20px;
}

.back-to-login a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.back-to-login a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .auth-container {
        padding: 30px 20px;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .verification-inputs {
        gap: 10px;
    }
    
    .verification-input {
        width: 50px;
        height: 60px;
        font-size: 1.3rem;
    }
}

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

    .auth-header h1 {
        font-size: 1.3rem;
    }
    
    .verification-inputs {
        gap: 8px;
    }
    
    .verification-input {
        width: 45px;
        height: 55px;
        font-size: 1.2rem;
    }
    
    .terms-checkbox label {
        font-size: 0.8rem;
    }
    
    .logo-image {
        height: 28px;
    }
    
    .back-home {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* Additional Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

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

.text-error {
    color: var(--error-color);
}

.text-success {
    color: var(--success-color);
}

.text-primary {
    color: var(--primary-color);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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