/*!
 * PeerX Authentication Styles
 * Styles for login, register, and authentication pages
 */

/* ===== AUTH LAYOUT ===== */
.auth-body {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    position: relative;
}

/* ===== ANIMATED BACKGROUND ===== */
.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, var(--primary-500), var(--primary-700));
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, var(--primary-400), var(--primary-600));
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.orb-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(45deg, var(--primary-300), var(--primary-500));
    bottom: 20%;
    left: 50%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
    }
    50% {
        transform: translateY(0px) rotate(180deg);
    }
    75% {
        transform: translateY(10px) rotate(270deg);
    }
}

/* ===== AUTH CONTENT ===== */
.auth-content {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-logo .logo {
    width: 40px;
    height: 40px;
}

.auth-logo .logo-image {
    height: 60px;
    width: auto;
    margin: 0 auto;
}

/* 로고 테마 전환 */
.auth-logo .logo-image.logo-dark {
    display: block;
}
.auth-logo .logo-image.logo-light {
    display: none;
}
[data-theme="light"] .auth-logo .logo-image.logo-dark {
    display: none;
}
[data-theme="light"] .auth-logo .logo-image.logo-light {
    display: block;
}

.auth-logo .brand-text {
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== AUTH CARD ===== */
.auth-card {
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all var(--transition-normal);
}

.auth-card:hover {
    border-color: rgba(20, 184, 166, 0.2);
    box-shadow: 0 25px 50px -12px rgba(20, 184, 166, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-header h1 {
    margin-bottom: var(--space-2);
    background: linear-gradient(135deg, var(--text-primary), var(--primary-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-tertiary);
    margin: 0;
}

/* ===== AUTH FORM ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.auth-form .form-group {
    position: relative;
}

.auth-form label {
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-form input {
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.auth-form input:focus {
    background: rgba(26, 26, 26, 0.9);
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Password Input */
.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-1);
    transition: color var(--transition-fast);
}

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

/* Password Strength Indicator */
.password-strength {
    margin-top: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    transition: all var(--transition-fast);
}

.password-strength.very-weak {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.password-strength.weak {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.password-strength.fair {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.password-strength.good {
    background: rgba(20, 184, 166, 0.1);
    color: var(--primary-400);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.password-strength.strong {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.forgot-link {
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

/* Checkbox Styling */
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-text {
    flex: 1;
    line-height: 1.5;
}

.checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 1rem;
    height: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    display: inline-block;
    position: relative;
    transition: all var(--transition-fast);
}

.checkbox input:checked + .checkmark {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkbox input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ===== SOCIAL LOGIN ===== */
.social-divider {
    position: relative;
    text-align: center;
    margin: var(--space-6) 0;
}

.social-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.social-divider span {
    background: rgba(17, 17, 17, 0.8);
    padding: 0 var(--space-4);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.social-buttons {
    display: flex;
    gap: var(--space-3);
}

.btn-social {
    flex: 1;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.btn-social:hover {
    background: rgba(26, 26, 26, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-social .social-icon {
    width: 1rem;
    height: 1rem;
}

.btn-google:hover {
    border-color: #4285f4;
    box-shadow: 0 0 0 1px rgba(66, 133, 244, 0.1);
}

.btn-facebook:hover {
    border-color: #1877F2;
    box-shadow: 0 0 0 1px rgba(24, 119, 242, 0.1);
}

.btn-kakao:hover {
    border-color: #FFE812;
    box-shadow: 0 0 0 1px rgba(255, 232, 18, 0.1);
}

/* ===== AUTH LINKS ===== */
.auth-links {
    text-align: center;
    margin-top: var(--space-6);
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.link-primary {
    color: var(--primary-400);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ===== AUTH FOOTER ===== */
.auth-footer {
    text-align: center;
    margin-top: var(--space-8);
    font-size: 0.75rem;
    color: var(--text-quaternary);
}

.auth-footer p {
    margin: var(--space-2) 0;
}

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

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

.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: rgba(16, 185, 129, 0.1);
    padding: var(--space-3);
    border-radius: var(--radius);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

/* ===== BUTTON LOADING STATE ===== */
.btn-loader {
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== RESPONSIVE AUTH DESIGN ===== */
@media (max-width: 768px) {
    .auth-container {
        padding: var(--space-4);
    }

    .auth-content {
        max-width: 100%;
    }

    .auth-card {
        padding: var(--space-6);
    }

    .orb-1 {
        width: 200px;
        height: 200px;
        top: 10%;
        left: -10%;
    }

    .orb-2 {
        width: 150px;
        height: 150px;
        top: 70%;
        right: -10%;
    }

    .orb-3 {
        width: 100px;
        height: 100px;
        bottom: 30%;
        left: 40%;
    }

    .social-buttons {
        flex-direction: column;
    }

    .form-options {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: var(--space-4);
        border-radius: var(--radius-lg);
    }

    .auth-header {
        margin-bottom: var(--space-6);
    }

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

    .auth-logo {
        margin-bottom: var(--space-6);
    }

    .auth-logo a {
        font-size: 1.25rem;
    }

    .auth-logo .logo {
        width: 32px;
        height: 32px;
    }

    .auth-logo .logo-image {
        height: 48px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .gradient-orb {
        animation: none;
    }

    .auth-card {
        transition: none;
    }

    .btn-loader {
        animation: none;
        border: 2px solid currentColor;
        border-top-color: transparent;
    }
}

/* Focus states for keyboard navigation */
.auth-form input:focus-visible,
.btn:focus-visible,
.checkbox:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        background: rgba(17, 17, 17, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .auth-form input {
        background: rgba(26, 26, 26, 0.95);
        border: 2px solid rgba(255, 255, 255, 0.2);
    }
}

/* ===== WELCOME PAGE ===== */
.success-icon {
    margin: 0 auto var(--space-4);
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.user-email {
    color: #74b9ff;
    font-weight: 600;
    margin-top: var(--space-2);
    font-size: 1.125rem;
}

.welcome-content {
    margin: var(--space-6) 0;
}

.next-steps,
.features {
    margin-bottom: var(--space-6);
}

.next-steps h3,
.features h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-4);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
}

.steps-list {
    list-style: none;
    padding: 0;
}

.steps-list li {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: var(--space-3);
    transition: background 0.3s, transform 0.2s;
}

.steps-list li:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.step-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.steps-list strong {
    display: block;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--space-1);
    font-weight: 600;
}

.steps-list p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

.features-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.features-list li {
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    transition: background 0.3s, transform 0.2s;
}

.features-list li:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.02);
}

.welcome-footer {
    margin-top: var(--space-6);
}

.countdown-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
}

.countdown-text span {
    color: #74b9ff;
    font-weight: 700;
    font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 640px) {
    .features-list {
        grid-template-columns: 1fr;
    }

    .step-icon {
        font-size: 1.5rem;
    }

    .user-email {
        font-size: 1rem;
    }
}