/* ============================================
   TPL-6: Fintech Dark Premium
   Premium trading platform login theme
   ============================================ */

:root {
    --tpl6-bg-primary: #0A0E17;
    --tpl6-bg-secondary: #0F1420;
    --tpl6-bg-card: rgba(15, 20, 32, 0.85);
    --tpl6-border: rgba(255, 255, 255, 0.08);
    --tpl6-border-focus: rgba(59, 130, 246, 0.5);
    --tpl6-text-primary: #FFFFFF;
    --tpl6-text-secondary: #94A3B8;
    --tpl6-text-muted: #64748B;
    --tpl6-accent-blue: #3B82F6;
    --tpl6-accent-blue-hover: #2563EB;
    --tpl6-accent-gold: #F59E0B;
    --tpl6-success: #10B981;
    --tpl6-error: #EF4444;
    --tpl6-font-display: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    --tpl6-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Base Styles */
.tpl-6-body {
    font-family: var(--tpl6-font-body);
    background: var(--tpl6-bg-primary);
    color: var(--tpl6-text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    height: auto;
}

/* Background Effects */
.tpl6-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.tpl6-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.tpl6-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: tpl6-float 20s ease-in-out infinite;
}

.tpl6-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: tpl6-float 25s ease-in-out infinite reverse;
}

@keyframes tpl6-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.tpl6-trading-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.tpl6-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.5;
}

.tpl6-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.4;
}

/* Floating Ticker */
.tpl6-ticker {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 16px;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.tpl6-ticker:hover {
    opacity: 1;
}

.tpl6-ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--tpl6-bg-card);
    border: 1px solid var(--tpl6-border);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-size: 12px;
}

.tpl6-ticker-symbol {
    color: var(--tpl6-text-secondary);
    font-weight: 600;
    font-family: var(--tpl6-font-display);
}

.tpl6-ticker-price {
    color: var(--tpl6-text-primary);
    font-weight: 500;
}

.tpl6-ticker-change {
    font-weight: 600;
    font-size: 11px;
}

.tpl6-ticker-change.positive { color: var(--tpl6-success); }
.tpl6-ticker-change.negative { color: var(--tpl6-error); }

/* Main Container */
.tpl6-container {
    position: relative;
    z-index: 1;
    /*min-height: 100vh;*/
    display: block;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* Card */
.tpl6-card {
    width: 100%;
    max-width: 420px;
    background: var(--tpl6-bg-card);
    border: 1px solid var(--tpl6-border);
    border-radius: 24px;
    padding: 26px 34px;
    backdrop-filter: blur(20px);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -2px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: tpl6-card-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tpl6-card-appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.tpl6-logo {
    text-align: center;
    margin-bottom: 32px;
}

.tpl6-logo img {
    max-width: 180px;
    height: auto;
    filter: brightness(1.1);
}

/* Form Styles */
.tpl-6-body .nz-lgs-v-login,
.tpl-6-body .nz-lgs-v-signup{
    width: 350px;
}

.tpl-6-body .nz-login-act {
    width: 100%;
}

.tpl-6-body .nz-login-field {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tpl-6-body .form-group {
    position: relative;
    margin-bottom: 0;
}

.tpl-6-body .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--tpl6-text-secondary);
    margin-bottom: 8px;
    font-family: var(--tpl6-font-body);
}

.tpl-6-body .form-group label i {
    margin-right: 8px;
    color: var(--tpl6-text-muted);
}

.tpl-6-body .form-control {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--tpl6-border);
    border-radius: 12px;
    color: var(--tpl6-text-primary);
    font-size: 15px;
    font-family: var(--tpl6-font-body);
    transition: all 0.2s ease;
}

.tpl-6-body .form-control::placeholder {
    color: var(--tpl6-text-muted);
}

.tpl-6-body .form-control:focus {
    outline: none;
    border-color: var(--tpl6-accent-blue);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tpl-6-body .form-control.nz-inp-error {
    border-color: var(--tpl6-error);
    background: rgba(239, 68, 68, 0.05);
}

/* Error Messages */
.tpl-6-body .nz-i-msg-f-kr_usr_email span,
.tpl-6-body .nz-i-msg-f-kr_usr_pwd span,
.tpl-6-body .nz-i-msg-f-kr_usr_name span,
.tpl-6-body .nz-i-msg-f-kr_usr_rep_pwd span,
.tpl-6-body .nz-i-msg-f-kr_usr_pwdr span,
.tpl-6-body .nz-i-msg-f-kr_usr_pwdr_rep span {
    display: block;
    font-size: 12px;
    color: var(--tpl6-error);
    margin-top: 6px;
    padding-left: 2px;
}

/* Password Field */
.tpl-6-body .password-field {
    position: relative;
}

.tpl-6-body .password-field .input-group {
    position: relative;
    display: flex;
    align-items: center;
}

/* Fix Bootstrap input-group radius cutting on password field */
.tpl-6-body .password-field .input-group > .form-control {
    border-radius: 12px;
}

.tpl-6-body .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--tpl6-text-muted);
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
    z-index: 3;
}

.tpl-6-body .password-toggle:hover {
    color: var(--tpl6-text-primary);
}

/* Links */
.tpl-6-body .nz-resetpassword-view,
.tpl-6-body .nz-gologin-view {
    color: var(--tpl6-accent-blue);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
}

.tpl-6-body .nz-resetpassword-view:hover,
.tpl-6-body .nz-gologin-view:hover {
    color: var(--tpl6-accent-blue-hover);
    text-decoration: underline;
}

/* Primary Button */
.tpl-6-body .btn-primary,
.tpl-6-body button.g-recaptcha,
.tpl-6-body input[type="submit"].btn-primary {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, var(--tpl6-accent-blue) 0%, var(--tpl6-accent-blue-hover) 100%);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--tpl6-font-display);
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.tpl-6-body .btn-primary:hover,
.tpl-6-body button.g-recaptcha:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.tpl-6-body .btn-primary:active,
.tpl-6-body button.g-recaptcha:active {
    transform: translateY(0);
}

/* Separator */
.tpl-6-body .nz-login-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.tpl-6-body .nz-login-separator div {
    flex: 1;
    height: 1px;
    background: var(--tpl6-border);
}

.tpl-6-body .nz-login-separator span {
    color: var(--tpl6-text-muted);
    font-size: 13px;
    text-transform: lowercase;
}

/* OAuth Buttons */
.tpl-6-body .nz-login-oauth {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tpl-6-body .nz-login-oauth > div {
    display: flex;
    gap: 12px;
}

.tpl-6-body .nz-login-oauth a {
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.tpl-6-body .nz-login-oauth a:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.tpl-6-body .nz-login-oauth-icn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpl-6-body .nz-login-oauth-icn svg {
    width: 20px;
    height: 20px;
}

/* Create Account Button */
.tpl-6-body .nz-login-signup-ctrl {
    background: linear-gradient(135deg, var(--tpl6-accent-gold) 0%, #D97706 100%) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.tpl-6-body .nz-login-signup-ctrl:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.tpl-6-body .nz-login-signup-ctrl .nz-login-oauth-name {
    color: #FFFFFF !important;
    font-weight: 600;
}

/* Checkbox */
.tpl-6-body .nz-signup-check {
    margin-top: 8px;
}

.tpl-6-body .control {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--tpl6-text-secondary);
    font-size: 14px;
    cursor: pointer;
}

.tpl-6-body .control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tpl6-accent-blue);
}

.tpl-6-body .control i {
    color: var(--tpl6-accent-blue);
    cursor: pointer;
}

/* Loading Spinner */
.tpl6-loading {
    background: var(--tpl6-bg-primary) !important;
}

.tpl6-loader {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpl6-loader-ring {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tpl6-border);
    border-top-color: var(--tpl6-accent-blue);
    border-radius: 50%;
    animation: tpl6-spin 0.8s linear infinite;
}

@keyframes tpl6-spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.tpl6-footer {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.tpl6-lang-select {
    position: relative;
}

.tpl6-lang-select > div {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--tpl6-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tpl6-lang-select > div:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tpl6-lang-select > div img {
    width: 20px;
    height: 14px;
    border-radius: 2px;
}

.tpl6-lang-select > div span {
    font-size: 13px;
    color: var(--tpl6-text-secondary);
}

.tpl6-lang-select ul {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px;
    background: var(--tpl6-bg-secondary);
    border: 1px solid var(--tpl6-border);
    border-radius: 12px;
    list-style: none;
    display: none;
    min-width: 160px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.tpl6-lang-select ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--tpl6-text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.tpl6-lang-select ul li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--tpl6-text-primary);
}

.tpl6-lang-select ul li a img {
    width: 20px;
    height: 14px;
    border-radius: 2px;
}

.tpl6-legal-links {
    display: flex;
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tpl6-legal-links li a {
    color: var(--tpl6-text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.tpl6-legal-links li a:hover {
    color: var(--tpl6-text-secondary);
}

/* Cookie Banner */
.tpl-6-body div.nz-cookie-approval {
    gap: 16px;
    position: fixed;
}

.tpl6-cookie-icon {
    font-size: 28px;
    color: var(--tpl6-accent-gold);
}

.tpl6-cookie-content {
    flex: 1;
}

.tpl6-cookie-content span {
    display: block;
    text-align-last: center;
    margin-bottom: 4px;
    color: var(--tpl6-bg-primary);
}

.tpl6-cookie-content p {
    font-size: 13px;
    color: var(--tpl6-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.tpl6-btn-accept {
    padding: 10px 20px;
    background: var(--tpl6-accent-blue);
    border: none;
    border-radius: 8px;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tpl6-btn-accept:hover {
    background: var(--tpl6-accent-blue-hover);
}

/* 2FA Styles */
.tpl-6-body .nz-login-tfs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.tpl-6-body .nz-login-tfs > section {
    background: var(--tpl6-bg-card);
    border: 1px solid var(--tpl6-border);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    /* Ensure 2FA input/button stay accessible on small viewports */
    max-height: 550px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 520px;
}

.tpl-6-body .nz-login-tfs img {
    width: 80px;
    margin-bottom: 24px;
}

.tpl-6-body .nz-login-tfs span {
    display: block;
    color: var(--tpl6-text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.tpl-6-body .nz-login-tfs input[type="text"] {
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--tpl6-border);
    border-radius: 12px;
    color: var(--tpl6-text-primary);
    font-size: 28px;
    font-family: var(--tpl6-font-display);
    letter-spacing: 8px;
    text-align: center;
    margin-bottom: 24px;
}

.tpl-6-body .nz-login-tfs input[type="text"]:focus {
    outline: none;
    border-color: var(--tpl6-accent-blue);
}

.tpl-6-body .nz-login-tfs input[type="submit"] {
    width: 100%;
    height: 52px;
    background: var(--tpl6-accent-blue);
    border: none;
    border-radius: 12px;
    color: #FFFFFF;
    font-weight: 600;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tpl6-ticker {
        display: none;
    }

    .tpl6-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .tpl6-container {
        padding: 20px 16px;
    }

    .tpl-6-body .form-control {
        height: 48px;
    }

    .tpl-6-body .btn-primary,
    .tpl-6-body button.g-recaptcha {
        height: 48px;
    }

    .tpl6-cookie {
        flex-direction: column;
        text-align: center;
        left: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .tpl6-logo img {
        max-width: 140px;
    }

    .tpl6-card {
        padding: 28px 20px;
    }

    .tpl-6-body .nz-login-oauth > div {
        flex-direction: column;
    }

    .tpl6-legal-links {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Hide default loading cube in favor of our loader */
.tpl-6-body .sk-folding-cube {
    display: none !important;
}

/* Animations */
.tpl-6-body .nz-login-view {
    animation: tpl6-fade-in 0.4s ease;
}

@keyframes tpl6-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
