/* ==========================================================================
   RAMIX MUSIC — AUTH & LEGAL DESIGN SYSTEM (Self-Contained, Black & Orange)
   ========================================================================== */

:root {
    --bg: #050505;
    --surface: #0c0c0c;
    --surface-2: #141414;
    --accent: #e37b47;
    --accent-hover: #ef8c58;
    --line: #222222;
    --text: #f5f5f5;
    --muted: #8b8b8b;
    --container: 1180px;
}

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

html {
    zoom: 1 !important;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Montserrat", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   AUTH PAGE (Strict Center, 100vh Viewport, Zero Scroll)
   ========================================================================== */

body.auth-page {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden !important;
    background:
        radial-gradient(circle at -8% 100%, rgba(227, 123, 71, .3) 0, rgba(104, 48, 24, .15) 18%, transparent 43%),
        radial-gradient(circle at 105% 6%, rgba(227, 123, 71, .25) 0, rgba(90, 42, 24, .12) 19%, transparent 45%),
        #050505;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.auth-shell {
    width: 100%;
    max-width: 530px;
    padding: 24px 20px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Auth Card */
.auth-card {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid #222222;
    border-radius: 16px;
    padding: 36px 34px 28px;
    box-shadow: 
        0 24px 60px rgba(0, 0, 0, 0.85),
        0 0 35px rgba(227, 123, 71, 0.05);
    box-sizing: border-box;
}

/* Header */
.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(26px, 3.2vw, 32px);
    line-height: 1;
    font-style: italic;
    font-weight: 900;
    letter-spacing: -.045em;
    text-transform: uppercase;
}

.auth-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}

.auth-logo:hover {
    transform: translateY(-2px);
}

.auth-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Alert */
.auth-alert {
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px solid rgba(227, 123, 71, .5);
    border-radius: 8px;
    background: rgba(227, 123, 71, .1);
    color: #f3c3aa;
    font-size: 12.5px;
    line-height: 1.4;
}

/* Form Fields */
.auth-form {
    display: grid;
    gap: 16px;
}

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-field {
    display: grid;
    gap: 7px;
}

.auth-field label {
    color: #9e9e9e;
    font-size: 11.5px;
    line-height: 1.2;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.auth-field input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    box-sizing: border-box;
    outline: none;
    border: 1px solid #282828;
    border-radius: 8px;
    background: #141414;
    color: #ffffff;
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-field input::placeholder {
    color: #555555;
}

.auth-field input:hover {
    border-color: #383838;
}

.auth-field input:focus {
    border-color: var(--accent);
    background: #181818;
    box-shadow: 0 0 0 2px rgba(227, 123, 71, .15);
}

/* Password Toggle */
.auth-pwd-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-pwd-wrap input {
    padding-right: 44px;
}

.auth-pwd-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    color: #666666;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s ease;
}

.auth-pwd-btn:hover {
    color: #cccccc;
}

/* Checkbox Policy */
.auth-policy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin: 2px 0 4px;
}

.auth-policy input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    border: 1px solid #383838;
    border-radius: 5px;
    background: #141414;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.auth-checkbox svg {
    display: none;
    color: #111111;
}

.auth-policy input:checked + .auth-checkbox {
    background: var(--accent);
    border-color: var(--accent);
}

.auth-policy input:checked + .auth-checkbox svg {
    display: block;
}

.auth-policy-text {
    font-size: 11.5px;
    line-height: 1.45;
    color: #888888;
}

.auth-policy-text a {
    color: var(--accent);
    text-decoration: none;
}

.auth-policy-text a:hover {
    text-decoration: underline;
}

/* Action Buttons */
.auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 8px;
}

.button,
.auth-submit-btn,
.auth-back-btn,
.legal-back-btn,
.legal-reg-btn {
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease !important;
}

.button:hover,
.auth-submit-btn:hover,
.auth-back-btn:hover,
.legal-back-btn:hover,
.legal-reg-btn:hover {
    transform: translateY(-2px);
}

/* Primary Button (Orange) */
.button-primary,
.auth-submit-btn,
.legal-reg-btn {
    background: #e37b47 !important;
    color: #0c0c0c !important;
    border: 1px solid transparent !important;
    box-shadow: 0 4px 14px rgba(227, 123, 71, 0.25);
}

.button-primary:hover,
.auth-submit-btn:hover,
.legal-reg-btn:hover {
    background: #ef8c58 !important;
    box-shadow: 0 6px 18px rgba(227, 123, 71, 0.4);
}

/* Outline Button (Dark with Orange Border) */
.button-outline,
.auth-back-btn,
.legal-back-btn {
    background: rgba(18, 18, 18, 0.8) !important;
    border: 1px solid rgba(227, 123, 71, .45) !important;
    color: #ffffff !important;
}

.button-outline:hover,
.auth-back-btn:hover,
.legal-back-btn:hover {
    border-color: #e37b47 !important;
    color: #e37b47 !important;
    background: rgba(227, 123, 71, 0.08) !important;
}

/* Footer Link Switch */
.auth-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #1a1a1a;
    text-align: center;
    font-size: 12.5px;
    color: #777777;
}

.auth-footer a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
    transition: color .2s ease;
}

.auth-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ==========================================================================
   LEGAL PAGES
   ========================================================================== */

body.legal-page {
    width: 100%;
    min-height: 100vh;
    overflow-y: auto !important;
    display: block !important;
    background: #050505;
}

.legal-shell {
    width: min(calc(100% - 48px), var(--container, 1180px));
    margin: 40px auto;
    padding: 0;
    box-sizing: border-box;
}

.legal-card {
    width: 100%;
    background: #0c0c0c;
    border: 1px solid #202020;
    border-radius: 16px;
    padding: 36px 40px 32px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    box-sizing: border-box;
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #1c1c1c;
    margin-bottom: 24px;
}

.legal-header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.legal-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.legal-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.legal-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.1;
    font-style: italic;
    font-weight: 900;
    letter-spacing: -.04em;
    text-transform: uppercase;
}

.legal-back-btn {
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 22px !important;
    font-size: 11px !important;
    flex-shrink: 0;
}

.legal-copy-wrap {
    width: 100%;
    margin-bottom: 24px;
}

.legal-copy {
    width: 100%;
    box-sizing: border-box;
    max-height: min(68vh, 750px);
    overflow-y: auto;
    padding: 26px 30px;
    background: #111111;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) #111111;
}

.legal-copy::-webkit-scrollbar {
    width: 6px;
}

.legal-copy::-webkit-scrollbar-track {
    background: #111111;
    border-radius: 6px;
}

.legal-copy::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 6px;
}

.legal-copy pre {
    margin: 0;
    font-family: "Montserrat", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #cfcfcf;
    white-space: pre-wrap;
    word-break: break-word;
}

.legal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid #1c1c1c;
    flex-wrap: wrap;
}

.legal-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.legal-footer-links a {
    color: #888888;
    font-size: 12px;
    text-decoration: none;
    transition: color .2s ease;
}

.legal-footer-links a:hover {
    color: var(--accent);
}

.legal-dot {
    color: #444444;
    font-size: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .auth-card {
        padding: 24px 20px 18px;
    }
    .auth-grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .legal-card {
        padding: 22px 16px;
    }
    .legal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .legal-copy {
        padding: 18px 14px;
    }
    .legal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .legal-reg-btn {
        width: 100% !important;
    }
}

/* Captcha & Anti-bot Styles */
.auth-captcha-wrap {
    display: grid;
    gap: 7px;
}

.auth-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.auth-captcha-img-box {
    flex: 0 0 130px;
    width: 130px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #282828;
    background: #0d0d0d;
}

.auth-captcha-img-box img {
    width: 130px;
    height: 46px;
    display: block;
    user-select: none;
}

.auth-captcha-refresh {
    flex: 0 0 44px;
    width: 44px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #141414;
    border: 1px solid #282828;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    transition: all .2s ease;
}

.auth-captcha-refresh:hover {
    color: var(--accent);
    border-color: #444;
    background: #1a1a1a;
}

.auth-captcha-refresh.is-spinning svg {
    animation: captchaSpin 0.5s linear infinite;
}

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

.auth-captcha-input {
    flex: 1 1 auto;
    min-width: 70px;
    height: 46px !important;
    letter-spacing: 0.15em;
    font-weight: 700;
    text-align: center;
    font-size: 15px !important;
    padding: 0 8px !important;
}

.auth-hp-field {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Language Switcher for Auth */
.auth-lang-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
    width: 100%;
}
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    user-select: none;
}
.lang-btn {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    padding: 2px 7px;
    border-radius: 12px;
    transition: all 0.2s ease;
}
.lang-btn:hover {
    color: #fff;
}
.lang-btn.is-active {
    color: #050505;
    background: var(--accent, #e37b47);
    font-weight: 800;
}
.lang-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 10px;
}

