:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-accent: rgba(59, 130, 246, 0.5);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.4) rgba(0, 0, 0, 0.25);
}

/* Custom Cyberpunk Scrollbar */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.4), rgba(59, 130, 246, 0.4));
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.75), rgba(59, 130, 246, 0.75));
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

body, html {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #0a0e1a;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

.premium-card {
    width: 100%;
    max-width: 440px;
    margin: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-premium);
    position: relative;
    text-align: center;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: padding 0.2s ease;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

@media (max-width: 480px) {
    body, html {
        padding: 1.25rem 1rem;
        justify-content: center;
        align-items: center;
    }

    .premium-card {
        padding: 1.75rem 1.25rem;
        border-radius: 22px;
        margin: auto;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: var(--text-main);
    font-size: 16px; /* Prevents auto-zoom in iOS Safari */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
}

input:focus {
    border-color: var(--glass-accent);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    width: 100%;
    min-height: 46px;
    padding: 0.85rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.3);
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.links {
    margin-top: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 1px solid transparent;
}

.links a:hover {
    color: var(--text-main);
    border-bottom-color: var(--primary);
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
    text-align: left;
}

/* Specific to Register */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Specific to No-License */
.lock-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* OAuth Social Login Styles */
.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.oauth-divider::before {
    margin-right: 0.75rem;
}

.oauth-divider::after {
    margin-left: 0.75rem;
}

.oauth-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 0.5rem;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    padding: 0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border);
    outline: none;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    -webkit-appearance: none;
    appearance: none;
}

.btn-oauth svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.btn-oauth:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-oauth:active:not(:disabled) {
    transform: translateY(0);
}

.btn-oauth:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-oauth.btn-google:hover:not(:disabled) {
    background: rgba(234, 67, 53, 0.12);
    border-color: rgba(234, 67, 53, 0.4);
    box-shadow: 0 4px 15px rgba(234, 67, 53, 0.15);
}

.btn-oauth.btn-telegram:hover:not(:disabled) {
    background: rgba(41, 169, 234, 0.12);
    border-color: rgba(41, 169, 234, 0.4);
    box-shadow: 0 4px 15px rgba(41, 169, 234, 0.15);
}

.btn-oauth.btn-github:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.12);
}

#telegramWidgetContainer {
    display: none;
    justify-content: center;
    margin-top: 0.5rem;
}
