/**
 * Auth Shared CSS - Common Styles for Login, Signup, Forgot Password Pages
 * 
 * Reduces CSS duplication across authentication pages
 * Include via: <link href="css/auth-shared.css" rel="stylesheet">
 */

/* ========================================
   BASE STYLES & RESETS
   ======================================== */
html {
    overflow-x: hidden;
    max-width: 100vw;
    touch-action: pan-y;
    -ms-touch-action: pan-y;
}

* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    position: relative;
    touch-action: pan-y;
    -ms-touch-action: pan-y;
    margin: 0;
    padding: 0;
}

/* ========================================
   GRADIENT BACKGROUND
   ======================================== */
.gradient-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 30%, #334155 100%);
    position: relative;
    overflow: hidden;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 198, 255, 0.1) 0%, transparent 50%);
}

/* ========================================
   GLASS CARD EFFECT
   ======================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ========================================
   FLOATING SHAPES ANIMATION
   ======================================== */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.shape:nth-child(2) {
    top: 60%;
    right: 10%;
    animation-delay: 7s;
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ec4899, #f59e0b);
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
}

.shape:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 14s;
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, #10b981, #3b82f6);
    border-radius: 50% 50% 30% 70% / 50% 30% 70% 50%;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(30px) rotate(240deg); }
}

/* ========================================
   INPUT FIELDS
   ======================================== */
.input-group {
    position: relative;
}

.input-field {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-demo {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transition: all 0.3s ease;
}

.btn-demo:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

/* ========================================
   LOGO & BRANDING
   ======================================== */
.logo-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   MESSAGES
   ======================================== */
.message-success {
    background: linear-gradient(135deg, #059669, #047857);
}

.message-error {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.message-info {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

/* ========================================
   ANIMATIONS
   ======================================== */
.card-enter {
    animation: cardEnter 0.8s ease-out;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.feature-item {
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .glass-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    
    .floating-shapes .shape {
        opacity: 0.05;
        animation-duration: 30s;
    }
}

/* ========================================
   PASSWORD TOGGLE & VALIDATION
   ======================================== */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.5rem;
    z-index: 10;
}

.password-toggle:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Password strength indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.password-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: all 0.3s ease;
    width: 0%;
}

.password-strength-bar.weak {
    width: 25%;
    background: #ef4444;
}

.password-strength-bar.fair {
    width: 50%;
    background: #f59e0b;
}

.password-strength-bar.good {
    width: 75%;
    background: #22c55e;
}

.password-strength-bar.strong {
    width: 100%;
    background: #10b981;
}

/* ========================================
   SOCIAL AUTH BUTTONS
   ======================================== */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.social-btn.google {
    border-color: rgba(234, 67, 53, 0.3);
}

.social-btn.google:hover {
    border-color: rgba(234, 67, 53, 0.6);
    background: rgba(234, 67, 53, 0.1);
}

.social-btn.telegram {
    border-color: rgba(0, 136, 204, 0.3);
}

.social-btn.telegram:hover {
    border-color: rgba(0, 136, 204, 0.6);
    background: rgba(0, 136, 204, 0.1);
}

/* ========================================
   DIVIDER
   ======================================== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   LOADING STATE
   ======================================== */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    top: 50%;
    left: 50%;
    margin-left: -0.625rem;
    margin-top: -0.625rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   FORM VALIDATION STATES
   ======================================== */
.input-field.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.input-field.success {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.field-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-error i {
    font-size: 0.625rem;
}
