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

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
    --input-focus: #4f46e5;
}

[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --border-color: #4a5568;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --input-bg: #2d3748;
    --input-border: #4a5568;
    --input-focus: #667eea;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--gradient-start) 0%, transparent 70%);
    opacity: 0.1;
    animation: rotate 30s linear infinite;
    pointer-events: none;
}

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

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--text-primary);
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.forms-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.form-wrapper {
    width: 100%;
    max-width: 480px;
    position: relative;
}

.form-panel {
    background: var(--bg-secondary);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50px);
}

.form-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: relative;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-link {
    display: inline-block;
    margin-bottom: 24px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.form-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.form-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

.auth-form {
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-control {
    width: 100%;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    padding: 14px 16px 14px 48px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-control:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-control:focus + .input-icon {
    fill: var(--input-focus);
}

.captcha-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-input-wrapper {
    flex: 1;
}

.captcha-input-wrapper .form-control {
    padding: 14px 16px;
}

.captcha-img-wrapper {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid var(--input-border);
    flex-shrink: 0;
}

.captcha-img-wrapper:hover {
    transform: scale(1.05);
    border-color: var(--input-focus);
}

.captcha-img {
    display: block;
    height: 50px;
    width: 120px;
}

.email-code-group {
    display: flex;
    gap: 12px;
}

.email-code-input {
    flex: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
}

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

.form-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.link:hover {
    text-decoration: underline;
}

.link-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.link-back:hover {
    color: var(--primary-color);
}

@media (max-width: 480px) {
    .form-panel {
        padding: 32px 24px;
    }

    .form-title {
        font-size: 28px;
    }

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

    .theme-toggle {
        width: 44px;
        height: 44px;
    }

    .captcha-group {
        flex-direction: column;
    }

    .captcha-img-wrapper {
        width: 100%;
    }

    .captcha-img {
        width: 100%;
        height: auto;
    }
}

