/* ==========================================================================
   AsterGro Chat - Autentifikatsiya va Kirish CSS (auth.css)
   Zamonaviy Telegram / Glassmorphism Dark Dizayn
   ========================================================================== */

:root {
    --bg-main: #0c1219;
    --bg-card: rgba(23, 33, 43, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-color: #2b5278;
    --primary-hover: #346392;
    --primary-accent: #2481cc;
    --text-primary: #ffffff;
    --text-secondary: #7e8b9b;
    --text-muted: #536171;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --input-bg: #18222d;
    --input-focus-border: #5288c1;
    --card-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 30px rgba(36, 129, 204, 0.15);
}

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

body.auth-body {
    min-height: 100vh;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(36, 129, 204, 0.18) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(124, 58, 237, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.9) 0px, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    padding: 20px;
    overflow-x: hidden;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: var(--card-shadow);
}

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

.auth-logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 22px;
    display: block;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05) rotate(3deg);
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(36, 129, 204, 0.15);
    border: 1px solid rgba(36, 129, 204, 0.3);
    color: #38bdf8;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 8px;
    font-weight: 500;
}

/* Tabs */
.auth-tabs {
    display: flex;
    background: rgba(14, 22, 33, 0.8);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab-btn.active {
    background: var(--primary-accent);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(36, 129, 204, 0.35);
}

/* Forms */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.auth-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s;
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px 12px 42px;
    font-size: 14.5px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(82, 136, 193, 0.2);
    background: #1b2633;
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-accent);
}

/* Avatar tanlash qatori */
.avatar-selection-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.avatar-preview {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-accent);
    background: #1e293b;
    flex-shrink: 0;
}

.avatar-choice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-choice-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Tugmalar */
.btn-submit {
    background: linear-gradient(135deg, #2481cc 0%, #1e6bb8 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(36, 129, 204, 0.35);
    transition: all 0.25s ease;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #2a92e6 0%, #2279d1 100%);
    box-shadow: 0 6px 20px rgba(36, 129, 204, 0.5);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(1px);
}

/* Alert xabarlari */
.auth-alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    display: none;
}

.auth-alert.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.auth-alert.success {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

/* Ajratuvchi chiziq (Divider) */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 12px;
}

/* Google Sign-in Tugmasi (Pasda joylashgan) */
.btn-google {
    width: 100%;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-google:hover {
    background: #f9fafb;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
}

.btn-google:active {
    transform: translateY(1px);
}

.btn-google svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google hisob tanlash modal oynasi */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.google-modal-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    color: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.92);
    transition: transform 0.25s ease;
}

.modal-overlay.active .google-modal-card {
    transform: scale(1);
}

.google-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.google-modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.google-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.google-account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.google-account-item:hover {
    background: rgba(36, 129, 204, 0.15);
    border-color: rgba(36, 129, 204, 0.4);
}

.google-account-item img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

.account-info {
    text-align: left;
}

.account-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.account-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}
