/* Shared reset + tokens per layout (matches PHP layouts/register + layouts/main) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.atg-layout-register {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --background: #f8fafc;
    --foreground: #1e293b;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --radius-xl: 16px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.atg-layout-main {
    --primary: #01bbad;
    --primary-dark: #019a8f;
    --background: #f8fafc;
    --foreground: #1e293b;
    --muted: #f1f5f9;
    --muted-foreground: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --radius-xl: 16px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--foreground);
}

/* --- Slim top header (register + success): logo image + language only --- */
body.atg-layout-register .simple-header,
body.atg-layout-main .simple-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.atg-layout-register .simple-header-content,
body.atg-layout-main .simple-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.atg-layout-register .simple-logo img,
body.atg-layout-main .simple-logo img {
    height: 32px;
    width: auto;
    display: block;
}

body.atg-layout-register .language-dropdown,
body.atg-layout-main .language-dropdown {
    position: relative;
}

body.atg-layout-register .language-dropdown-btn,
body.atg-layout-main .language-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.2s;
}

body.atg-layout-register .language-dropdown-btn:hover,
body.atg-layout-main .language-dropdown-btn:hover {
    background: var(--border);
}

body.atg-layout-register .dropdown-arrow,
body.atg-layout-main .dropdown-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

body.atg-layout-register .language-dropdown.active .dropdown-arrow,
body.atg-layout-main .language-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

body.atg-layout-register .language-dropdown-menu,
body.atg-layout-main .language-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
}

body.atg-layout-register .language-dropdown.active .language-dropdown-menu,
body.atg-layout-main .language-dropdown.active .language-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.atg-layout-register .language-option,
body.atg-layout-main .language-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--foreground);
    font-size: 0.875rem;
    transition: background 0.2s;
    border-bottom: 1px solid var(--muted);
}

body.atg-layout-register .language-option:last-child,
body.atg-layout-main .language-option:last-child {
    border-bottom: none;
}

body.atg-layout-register .language-option:hover,
body.atg-layout-main .language-option:hover {
    background: var(--muted);
}

body.atg-layout-register .language-option.active .lang-code,
body.atg-layout-main .language-option.active .lang-code {
    color: var(--primary);
    font-weight: 600;
}

body.atg-layout-register .lang-code,
body.atg-layout-main .lang-code {
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

body.atg-layout-register .lang-name,
body.atg-layout-main .lang-name {
    margin-right: 8px;
}

body.atg-layout-register .main-content {
    margin-top: 60px;
    width: 100%;
}

@media (max-width: 768px) {
    body.atg-layout-register {
        padding: 10px;
    }

    body.atg-layout-register .simple-header,
    body.atg-layout-main .simple-header {
        padding: 10px 16px;
    }

    body.atg-layout-register .simple-logo img,
    body.atg-layout-main .simple-logo img {
        height: 28px;
    }

    body.atg-layout-register .language-dropdown-menu,
    body.atg-layout-main .language-dropdown-menu {
        min-width: 120px;
    }
}

/* --- pages/register.php --- */
.auth-container {
    width: 100%;
    max-width: 480px;
    padding: 0 10px;
    margin: 10px auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--muted-foreground);
    font-size: 0.9375rem;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
    flex: 1;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: var(--foreground);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:hover {
    border-color: var(--primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

body.atg-layout-main .form-input:focus {
    box-shadow: 0 0 0 3px rgba(1, 187, 173, 0.12);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.account-type-fixed {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--muted);
    color: var(--foreground);
    cursor: default;
    user-select: none;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.success-message {
    background: #dcfce7;
    color: #16a34a;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.step-dot.active {
    background: var(--primary);
}

.hidden {
    display: none !important;
}

.deposit-mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 8px 0 12px;
}

.deposit-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--foreground);
}

.deposit-radio input {
    accent-color: var(--primary);
}

.form-hint {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}

.deposit-preset-select {
    margin-top: 4px;
}

.phone-input-group {
    display: flex;
    gap: 0;
}

.country-code-select {
    width: 140px;
    flex-shrink: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    text-align: center;
}

.phone-input-group .form-input:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.phone-input-wrapper {
    flex: 1;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .auth-title {
        font-size: 1.5rem;
    }
}

/* Success page wider container */
body.atg-layout-main .auth-container {
    max-width: 580px;
}

body.atg-layout-main .deposit-status-note {
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--muted-foreground, #64748b);
    background: var(--muted, #f1f5f9);
    border-radius: var(--radius, 8px);
}

body.atg-layout-main .deposit-status-note.deposit-status-warn {
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

body.atg-layout-main .main-wrapper {
    padding-top: 60px;
    min-height: 100vh;
}

/* --- register-success.php --- */
.success-card {
    background: white;
    box-shadow: var(--shadow-xl);
    padding: 48px;
    border: 1px solid var(--border);
    text-align: center;
    border-radius: var(--radius-xl);
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: #16a34a;
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 12px;
}

.success-subtitle {
    color: var(--muted-foreground);
    font-size: 1rem;
    margin-bottom: 32px;
    line-height: 1.6;
}

.mt5-info {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
    text-align: left;
}

.mt5-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #bbf7d0;
}

.mt5-info-header h3 {
    color: #16a34a;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.mt5-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #bbf7d0;
}

.mt5-info-row:last-child {
    border-bottom: none;
}

.mt5-info-label {
    color: #64748b;
    font-size: 0.875rem;
}

.mt5-info-value {
    font-weight: 600;
    color: var(--foreground);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    padding-right: 28px;
}

.mt5-info-value:hover {
    color: var(--primary);
}

.mt5-info-value.password {
    color: #16a34a;
    letter-spacing: 2px;
}

.mt5-info-value.password:hover {
    color: #15803d;
}

.mt5-info-value.clickable::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.mt5-info-value.clickable:hover::after {
    opacity: 1;
}

.copy-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.copy-toast svg {
    color: #16a34a;
}

.warning-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.warning-icon {
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-text {
    flex: 1;
    min-width: 0;
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: left;
}

body.atg-layout-main .success-card .btn {
    width: auto;
    margin-top: 32px;
    padding: 12px 48px;
}

.download-section {
    margin-top: 32px;
    text-align: left;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--foreground);
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.download-link:hover {
    background: var(--muted);
    border-color: var(--primary);
}

.download-content {
    flex: 1;
}

.download-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--foreground);
}

.download-desc {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.download-arrow {
    color: var(--primary);
    flex-shrink: 0;
}

.error-card {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}

.error-title {
    color: #dc2626;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-text {
    color: #991b1b;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .success-card {
        padding: 32px 24px;
    }

    .success-title {
        font-size: 1.5rem;
    }

    .mt5-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
