@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --bg-chat: #edeef0;
    --bg-msg-them: #fff;
    --bg-msg-them-border: #dce1e6;
    --text-main: #222;
    --text-muted: #656565;
    --header-bg: #fff;
    --header-border: #dce1e6;
    --input-bg: #f5f7fa;
    --input-border: #dce1e6;
    --reaction-bg: rgba(0,0,0,0.05);
    --code-bg: rgba(0,0,0,0.08);
    --modal-bg: #fff;
    --modal-border: #dce1e6;
    --modal-label: #656565;
}

[data-theme="dark"] {
    --bg-chat: #1a1d21;
    --bg-msg-them: #252830;
    --bg-msg-them-border: #363940;
    --text-main: #e1e3e6;
    --text-muted: #8a8e96;
    --header-bg: #1e2128;
    --header-border: #363940;
    --input-bg: #252830;
    --input-border: #363940;
    --reaction-bg: rgba(255,255,255,0.08);
    --code-bg: rgba(255,255,255,0.12);
    --modal-bg: #1e2128;
    --modal-border: #363940;
    --modal-label: #8a8e96;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; }
a, button, input, select, textarea { touch-action: manipulation; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #4a76a8;
    color: #222;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
}

/* === AUTH PAGES BACKGROUND === */
body.auth-page {
    background: linear-gradient(135deg, #5181b8 0%, #4a76a8 40%, #2a5885 100%);
    background-attachment: fixed;
    position: relative;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Background animations removed for performance */

/* === AUTH FORM === */
.auth-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo .logo-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 15px rgba(0,0,0,0.3));
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: -0.5px;
}

.auth-logo .subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
    font-weight: 400;
}

.auth-form {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.1),
        inset 0 1px 0 rgba(255,255,255,0.5);
    color: #222;
}

.auth-form h2 {
    margin-bottom: 8px;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: #2a5885;
}

.auth-form .form-desc {
    text-align: center;
    font-size: 14px;
    color: #656565;
    margin-bottom: 28px;
}

.auth-form .input-group {
    position: relative;
    margin-bottom: 16px;
}

.auth-form .input-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.5;
    pointer-events: none;
}
.auth-form input[type="tel"],
.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #dce1e6;
    border-radius: 14px;
    background: #f5f7fa;
    color: #222;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.auth-form input[type="tel"]:focus,
.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
    border-color: #4a76a8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(74, 118, 168, 0.15);
}

.auth-form input::placeholder {
    color: #939cb0;
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #5181b8, #4a76a8);
    color: #fff;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    margin-top: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(42, 88, 133, 0.3);
    letter-spacing: 0.3px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.auth-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #5b8fc4, #5181b8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 88, 133, 0.4);
}

.auth-form button[type="submit"]:active {
    transform: translateY(0);
}

.auth-form .auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #656565;
}

.auth-form .auth-footer a {
    color: #2a5885;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.auth-form .auth-footer a:hover {
    color: #5181b8;
    text-decoration: underline;
}

.error {
    color: #c62828;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}