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

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, #1a2e12 0%, #2d4a1e 30%, #3a5622 60%, #1a2e12 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -30%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(196,138,60,0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatBg 8s ease-in-out infinite;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -40%;
    left: -25%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139,195,74,0.06) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatBg 10s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes floatBg {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.auth-wrapper {
    display: flex;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.7s ease;
}

.auth-wrapper.full-width {
    max-width: 500px;
}

.auth-wrapper.split-layout {
    max-width: 1050px;
    min-height: 650px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-banner {
    flex: 1;
    background: linear-gradient(135deg, rgba(196,138,60,0.15) 0%, rgba(139,90,43,0.2) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.auth-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' opacity='0.06'%3E%3Cpath fill='none' stroke='%23f7e5c2' stroke-width='1.5' d='M70,100 Q100,70 130,100 Q100,130 70,100'/%3E%3Ccircle cx='100' cy='100' r='6' fill='%23f7e5c2'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 55px 55px;
}

.banner-logo {
    width: 90px;
    height: 90px;
    background: linear-gradient(145deg, #c48a3c, #8b5a2b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    animation: floatIcon 3s infinite ease-in-out;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.banner-logo i {
    font-size: 40px;
    color: #f7e5c2;
}

.banner-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.banner-logo .logo-fallback {
    font-size: 40px;
    color: #f7e5c2;
    display: flex;
}

.banner-content {
    position: relative;
    z-index: 1;
}

.banner-content h2 {
    font-size: 1.7rem;
    color: #f9e2b7;
    margin-bottom: 10px;
    font-weight: 800;
}

.banner-content p {
    color: rgba(249, 226, 183, 0.7);
    font-size: 0.88rem;
    line-height: 1.8;
}

.banner-features {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.banner-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    min-width: 75px;
}

.banner-feature i {
    font-size: 1.6rem;
    color: #f9e2b7;
    display: block;
    width: auto;
    height: auto;
    line-height: 1;
    transition: transform 0.3s ease;
}

.banner-feature:hover i {
    transform: translateY(-3px);
}

.banner-feature span {
    font-size: 0.8rem;
    color: rgba(249, 226, 183, 0.85);
    font-weight: 500;
    line-height: 1.4;
}

.auth-form-section {
    flex: 1;
    padding: 45px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.98);
}

.auth-form-section.full-width-form {
    flex: none;
    width: 100%;
}

.form-header {
    margin-bottom: 30px;
}

.form-header h1 {
    font-size: 1.7rem;
    color: #3b5522;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-header h1 i {
    color: #c48a3c;
    font-size: 1.6rem;
}

.form-header p {
    color: #8b7355;
    font-size: 0.85rem;
}

.tab-switcher {
    display: flex;
    background: #f5efe4;
    border-radius: 20px;
    padding: 5px;
    margin-bottom: 28px;
    gap: 5px;
}

.tab-btn {
    flex: 1;
    padding: 11px 18px;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.3s;
    color: #8b7355;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 0.95rem;
    transition: 0.3s;
}

.tab-btn.active {
    background: linear-gradient(135deg, #4b6e2e, #3a5622);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 85, 34, 0.3);
}

.tab-btn.active i {
    color: #ffda9e;
}

.tab-btn:not(.active):hover {
    background: rgba(139, 115, 85, 0.1);
}

.input-group {
    margin-bottom: 18px;
    position: relative;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    color: #5a4a35;
    margin-bottom: 8px;
}

.input-group label i {
    color: #c48a3c;
    width: 18px;
    text-align: center;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 42px 13px 16px;
    border: 2px solid #e8d9c2;
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.88rem;
    transition: all 0.3s;
    background: #fffdf9;
    color: #2c2a24;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #c48a3c;
    box-shadow: 0 0 0 4px rgba(196, 138, 60, 0.08);
    background: #fff;
}

.input-wrapper input::placeholder {
    color: #ccc;
}

.input-wrapper .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #b8863b;
    font-size: 1.05rem;
    pointer-events: none;
    transition: 0.3s;
}

.input-wrapper input:focus ~ .input-icon {
    color: #c48a3c;
}

.toggle-password {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #b8863b;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 5px;
    transition: 0.2s;
}

.toggle-password:hover {
    color: #c48a3c;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4b6e2e, #3a5622);
    border: none;
    border-radius: 16px;
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(75, 110, 46, 0.35);
}

.submit-btn:active {
    transform: scale(0.97);
}

.submit-btn .spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.submit-btn.loading .btn-text { display: none; }
.submit-btn.loading .spinner { display: block; }

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

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8b7355;
    text-decoration: none;
    font-size: 0.82rem;
    margin-bottom: 22px;
    transition: 0.2s;
}

.back-link:hover {
    color: #c48a3c;
    gap: 12px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 22px 0;
    color: #b0a18a;
    font-size: 0.78rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8d9c2;
}

.social-login {
    display: flex;
    gap: 12px;
}

.social-btn {
    flex: 1;
    padding: 11px;
    border: 2px solid #e8d9c2;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    color: #5a4a35;
}

.social-btn:hover {
    border-color: #c48a3c;
    background: #fffdf7;
    transform: translateY(-2px);
}

.social-btn.google i { color: #ea4335; }
.social-btn.telegram i { color: #0088cc; }

.error-input {
    border-color: #e74c3c !important;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.error-text {
    color: #e74c3c;
    font-size: 0.7rem;
    margin-top: 5px;
    display: none;
    align-items: center;
    gap: 5px;
}

.error-text.show {
    display: flex;
}

.error-message {
    background: #ffeaea;
    color: #d63031;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ffcccc;
    line-height: 1.8;
    animation: shake 0.4s ease;
}

.countdown-timer {
    text-align: center;
    margin: 15px 0;
    font-size: 0.82rem;
    color: #8b7355;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.countdown-timer i {
    color: #c48a3c;
}

.countdown-timer .time {
    font-weight: 700;
    color: #c48a3c;
    min-width: 30px;
    display: inline-block;
}

.sms-login-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 20px;
    margin-top: 14px;
    background: #fff;
    color: #4b6e2e;
    border: 2px solid #4b6e2e;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
}

.sms-login-link:hover {
    background: #f0f7ea;
    border-color: #3b5522;
    color: #3b5522;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(75, 110, 46, 0.15);
}

.switch-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.82rem;
    color: #8b7355;
}

.switch-text a {
    color: #c48a3c;
    text-decoration: none;
    font-weight: 700;
    transition: 0.2s;
}

.switch-text a:hover {
    color: #3b5522;
}

.password-hint {
    font-size: 0.72rem;
    color: #8b7355;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-hint i {
    color: #c48a3c;
}

@media (max-width: 850px) {
    body {
        padding: 12px;
    }

    .auth-wrapper.split-layout {
        flex-direction: column;
        max-width: 500px;
        min-height: auto;
    }

    .auth-banner {
        padding: 30px 22px;
    }

    .banner-logo {
        width: 65px;
        height: 65px;
    }

    .banner-logo i,
    .banner-logo .logo-fallback {
        font-size: 28px;
    }

    .banner-content h2 {
        font-size: 1.4rem;
    }

    .banner-content p {
        font-size: 0.78rem;
    }

    .banner-features {
        gap: 18px;
        margin-top: 18px;
    }

    .banner-feature i {
        font-size: 1.3rem;
    }

    .banner-feature span {
        font-size: 0.72rem;
    }

    .auth-form-section {
        padding: 30px 22px;
    }

    .form-header h1 {
        font-size: 1.4rem;
    }

    .form-header p {
        font-size: 0.78rem;
    }

    .tab-btn {
        padding: 9px 14px;
        font-size: 0.8rem;
    }

    .input-group {
        margin-bottom: 14px;
    }

    .input-group label {
        font-size: 0.76rem;
    }

    .input-wrapper input {
        padding: 11px 38px 11px 14px;
        font-size: 0.82rem;
    }

    .submit-btn {
        padding: 12px;
        font-size: 0.88rem;
    }

    .sms-login-link {
        padding: 11px 16px;
        font-size: 0.82rem;
    }
}

@media (max-width: 400px) {
    body {
        padding: 8px;
    }

    .auth-wrapper {
        border-radius: 28px;
    }

    .auth-banner {
        padding: 22px 16px;
    }

    .banner-logo {
        width: 55px;
        height: 55px;
        margin-bottom: 14px;
    }

    .banner-logo i,
    .banner-logo .logo-fallback {
        font-size: 24px;
    }

    .banner-content h2 {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }

    .banner-content p {
        font-size: 0.7rem;
    }

    .banner-features {
        gap: 14px;
        margin-top: 14px;
    }

    .banner-feature {
        min-width: 60px;
        gap: 5px;
    }

    .banner-feature i {
        font-size: 1.1rem;
    }

    .banner-feature span {
        font-size: 0.65rem;
    }

    .auth-form-section {
        padding: 22px 16px;
    }

    .form-header {
        margin-bottom: 20px;
    }

    .form-header h1 {
        font-size: 1.2rem;
    }

    .form-header h1 i {
        font-size: 1.1rem;
    }

    .form-header p {
        font-size: 0.72rem;
    }

    .tab-switcher {
        margin-bottom: 20px;
        border-radius: 16px;
        padding: 4px;
        gap: 4px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.74rem;
        border-radius: 12px;
    }

    .input-group {
        margin-bottom: 12px;
    }

    .input-group label {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }

    .input-wrapper input {
        padding: 10px 36px 10px 12px;
        font-size: 0.76rem;
        border-radius: 12px;
    }

    .input-wrapper .input-icon {
        right: 12px;
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 11px;
        font-size: 0.82rem;
        border-radius: 12px;
    }

    .sms-login-link {
        padding: 10px 14px;
        font-size: 0.76rem;
        border-radius: 12px;
    }

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

    .switch-text {
        font-size: 0.72rem;
        margin-top: 16px;
    }
}