:root {
    --primary: #0f2b76;
    --primary-light: #1a3a9e;
    --secondary: #5b21b6;
    --accent: #fbbf24;
    --accent-hover: #f59e0b;
    --bg-gradient: linear-gradient(135deg, #0f2b76 0%, #5b21b6 100%);
    --glass-bg: rgba(255, 255, 255, 0.09);
    --glass-border: rgba(255, 255, 255, 0.14);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.88);
    --text-muted: rgba(255, 255, 255, 0.55);
    --input-bg: rgba(255, 255, 255, 0.07);
    --input-border: rgba(255, 255, 255, 0.15);
    --error: #ef4444;
    --success: #10b981;
    --shadow: 0 20px 60px rgba(10, 20, 80, 0.5), 0 6px 20px rgba(15, 43, 118, 0.3);
    --shadow-light: 0 4px 16px rgba(15, 43, 118, 0.2);
    --shadow-hover: 0 24px 70px rgba(10, 20, 80, 0.6), 0 0 30px rgba(251, 191, 36, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.register-container {
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 44px 48px;
    width: 100%;
    max-width: 480px;
    position: relative;
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    will-change: transform, opacity;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.register-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(251, 191, 36, 0.4) 20%,
            rgba(251, 191, 36, 0.8) 50%,
            rgba(251, 191, 36, 0.4) 80%,
            transparent 100%);
    border-radius: 16px 16px 0 0;
}

.register-container::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -60%;
    width: 220%;
    height: 220%;
    background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.03) 0%, transparent 65%);
    pointer-events: none;
}

.register-container:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 255, 255, 0.18);
}

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

/* Title */
.register-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 28px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.3px;
    position: relative;
    z-index: 1;
}

/* Form */
.form-group {
    margin-bottom: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-label span {
    color: var(--error);
    font-weight: 400;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 15px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    position: relative;
    min-height: 48px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.09) !important;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    font-weight: 400;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    padding: 13px 16px;
    line-height: 1.6;
}

.invitation-code {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Autofill */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(50, 40, 110, 0.9) inset !important;
    box-shadow: 0 0 0 1000px rgba(50, 40, 110, 0.9) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-color: rgba(50, 40, 110, 0.9) !important;
    color: #ffffff !important;
    caret-color: #ffffff !important;
    background-image: none !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(50, 40, 110, 0.9) inset !important;
    box-shadow: 0 0 0 1000px rgba(50, 40, 110, 0.9) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    background-color: rgba(50, 40, 110, 0.9) !important;
    background-image: none !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

/* Select */
.form-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6,9 12,15 18,9'/></svg>") !important;
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    cursor: pointer;
    padding-right: 44px !important;
}

.form-select option {
    background-color: #1a2060 !important;
    color: #ffffff !important;
    font-size: 15px;
}

/* Error input state */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.06) !important;
    animation: shake 0.5s ease-in-out;
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Register Button */
.register-btn {
    width: 100%;
    padding: 14px 20px;
    background: #fbbf24;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    margin-top: 12px;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.35);
}

.register-btn:hover {
    background: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.45);
}

.register-btn:active {
    transform: translateY(0);
}

.register-btn:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.7);
    outline-offset: 2px;
}

/* Links */
.login-link {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-muted);
}

.login-link a {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.login-link a:hover {
    color: #fde68a;
}

/* Messages */
.error-message {
    color: var(--error);
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-left: 3px solid var(--error);
}

.error-message::before {
    content: '⚠';
    margin-right: 8px;
    font-size: 14px;
    flex-shrink: 0;
}

.info-message,
.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-left: 3px solid var(--success);
    color: var(--text-primary);
    padding: 14px 18px;
    margin-bottom: 24px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    animation: slideIn 0.4s ease-out;
}

.info-message::before {
    content: 'ℹ';
    margin-right: 10px;
    font-size: 16px;
    color: var(--success);
    flex-shrink: 0;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 12px;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: var(--success);
    border-color: var(--success);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.checkbox-wrapper input[type="checkbox"]:hover {
    border-color: rgba(251, 191, 36, 0.4);
}

.checkbox-wrapper label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    cursor: pointer;
}

.checkbox-wrapper a {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.checkbox-wrapper a:hover {
    color: #fde68a;
}

/* Telegram Button */
.telegram-btn {
    background: rgba(0, 136, 204, 0.85);
    color: white;
    border: 1px solid rgba(0, 170, 255, 0.25);
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

.telegram-btn:hover:not(:disabled) {
    background: rgba(0, 119, 187, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.35);
}

.telegram-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.telegram-btn:focus-visible {
    outline: 2px solid rgba(0, 136, 204, 0.6);
    outline-offset: 2px;
}

/* Verified Message */
.verified-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 14px;
}

.verified-message i {
    color: var(--success);
    font-size: 18px;
    flex-shrink: 0;
}

.form-text {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Input icon hidden */
.input-icon {
    display: none !important;
}

/* Legal modals (Kullanım Koşulları / Gizlilik) */
.legal-modal {
    display: none;
    position: fixed;
    z-index: 1500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 24px 16px;
}

.legal-modal .legal-modal-content {
    margin: 4vh auto;
    max-width: 640px;
    width: 100%;
    text-align: left;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    padding: 28px 32px 24px;
}

.legal-modal .legal-modal-content.fullscreen {
    max-width: min(900px, 96vw);
    max-height: 96vh;
}

.legal-modal .legal-modal-content::before {
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.6), transparent);
}

.legal-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 36px 16px 0;
    text-align: left;
}

.legal-modal .close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.legal-modal .close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.legal-body {
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    padding-right: 4px;
}

.legal-body p {
    margin-bottom: 12px;
}

.legal-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 18px 0 8px;
}

.legal-body ul {
    margin: 0 0 14px 1.1rem;
    padding: 0;
}

.legal-body li {
    margin-bottom: 6px;
}

.legal-body a {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 500;
}

.legal-body a:hover {
    color: #fde68a;
    text-decoration: underline;
}

.legal-updated {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px !important;
}

.legal-modal .read-more {
    display: inline-block;
    margin: 8px 0 4px;
    padding: 8px 16px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 8px;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.legal-modal .read-more:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.5);
}

.legal-modal .full-content {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 36px;
    border-radius: 14px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow);
    animation: modalSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.6), transparent);
    border-radius: 14px 14px 0 0;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.93); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
    font-size: 44px;
    color: var(--error);
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.modal-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
}

.modal-button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}

.modal-button:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Loading spinner */
.fa-spin {
    animation: spin 0.8s linear infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 6px; }
::-webkit-scrollbar-thumb { background: rgba(251,191,36,0.25); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(251,191,36,0.4); }

/* Responsive */
@media (max-width: 768px) {
    body { padding: 24px 16px; }

    .register-container {
        padding: 32px 28px;
        border-radius: 14px;
    }

    .register-title { font-size: 1.7rem; margin-bottom: 24px; }

    .form-input, .form-textarea {
        padding: 12px 14px;
        font-size: 15px;
        border-radius: 8px;
        min-height: 46px;
    }

    .form-select {
        padding: 12px 40px 12px 14px;
        font-size: 15px;
        border-radius: 8px;
        min-height: 46px;
    }

    .register-btn {
        padding: 14px;
        font-size: 14px;
        border-radius: 8px;
    }

    .modal-content { padding: 28px 22px; margin: 16px; border-radius: 12px; }
}

@media (max-width: 480px) {
    .register-container {
        padding: 28px 20px;
        border-radius: 12px;
    }

    .register-title { font-size: 1.5rem; margin-bottom: 22px; }

    .form-group { margin-bottom: 16px; }

    .form-input, .form-textarea {
        padding: 11px 13px;
        border-radius: 8px;
        min-height: 44px;
    }

    .register-btn {
        padding: 13px;
        border-radius: 8px;
    }

    .telegram-btn {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 8px;
    }

    .checkbox-wrapper { gap: 10px; }
    .checkbox-wrapper label { font-size: 12px; }
}
