/* ============================================
   Authentication Pages Styles
   ============================================ */

/* Auth Page Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
}

.auth-card {
    padding: 1.5rem 2rem;
    border-radius: 16px;
    background: linear-gradient(145deg, 
        rgba(16, 21, 30, 0.96) 0%,
        rgba(11, 14, 17, 0.99) 100%
    );
    border: 1px solid rgba(0, 126, 128, 0.06);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(0, 126, 128, 0.03),
        inset 0 1px 0 rgba(0, 126, 128, 0.05);
}

/* Logo Section */
.auth-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-logo-img {
    width: auto;
    height: 60px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    filter: brightness(1.8) drop-shadow(0 0 12px rgba(0, 52, 146, 0.4));
}

.auth-logo-tagline {
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: rgba(100, 160, 255, 0.5);
    text-transform: uppercase;
    margin-top: 6px;
}

/* Form Styles */
.auth-form {
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

/* OTP Input Group */
.otp-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 126, 128, 0.25);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    caret-color: #00b4b8;
}

.otp-digit:focus {
    border-color: #00b4b8;
    background: rgba(0, 126, 128, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 126, 128, 0.12);
}

.otp-digit::selection {
    background: rgba(0, 126, 128, 0.25);
}

/* OTP Actions */
.otp-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: #00b4b8;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: #00d4d8;
    text-decoration: underline;
}

.btn-link:disabled {
    color: #555;
    cursor: not-allowed;
    text-decoration: none;
}

.form-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.25rem;
    text-align: center;
}

.form-description {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin: 0 0 1rem;
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 0.85rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.35rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    z-index: 1;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: rgba(0, 126, 128, 0.35);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 126, 128, 0.08);
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-wrapper input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.toggle-password:hover {
    opacity: 1;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    background: #f6465d;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    min-width: 70px;
}

/* Form Error */
.form-error {
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid rgba(246, 70, 93, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ff6b81;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 10px 24px;
    font-size: 0.95rem;
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #007e80, #00b4b8, #b2e0e0, #00b4b8, #007e80);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: inherit;
}

.btn-glow:hover::before {
    opacity: 0.25;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-glow:hover .btn-shine {
    left: 100%;
}

.btn-danger {
    background: rgba(246, 70, 93, 0.15);
    border: 1px solid rgba(246, 70, 93, 0.3);
    color: #ff6b81;
}

.btn-danger:hover {
    background: rgba(246, 70, 93, 0.25);
    border-color: rgba(246, 70, 93, 0.5);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 0.75rem 0;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 1rem;
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
}

.auth-switch a {
    color: #007e80;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-switch a:hover {
    color: #00b4b8;
}

/* Auth Features */
.auth-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.feature-icon {
    font-size: 1rem;
}

/* ============================================
   Settings Page Styles
   ============================================ */

.settings-view {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.settings-card {
    border-radius: 16px;
    background: linear-gradient(145deg, 
        rgba(16, 21, 30, 0.9) 0%,
        rgba(11, 14, 17, 0.95) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.settings-card.account-info-card {
    grid-column: span 2;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-icon {
    font-size: 1.5rem;
}

.card-title-section h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.card-title-section p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.card-body {
    padding: 1.5rem;
}

/* API Status Badge */
.api-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.api-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.api-status.verified {
    background: rgba(14, 203, 129, 0.15);
    color: #0ecb81;
}

.api-status.verified .status-dot {
    background: #0ecb81;
    box-shadow: 0 0 8px rgba(14, 203, 129, 0.5);
}

.api-status.configured {
    background: rgba(0, 126, 128, 0.1);
    color: #007e80;
}

.api-status.configured .status-dot {
    background: #007e80;
    box-shadow: 0 0 8px rgba(0, 126, 128, 0.35);
}

.api-status.not-configured {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
}

.api-status.not-configured .status-dot {
    background: rgba(255, 255, 255, 0.3);
}

/* Trading Mode Selector */
.trading-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mode-option-large {
    cursor: pointer;
}

.mode-option-large input {
    display: none;
}

.mode-card-large {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mode-option-large input:checked + .mode-card-large {
    border-color: #007e80;
    background: rgba(0, 126, 128, 0.06);
}

.mode-card-large:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.mode-option-large input:checked + .mode-card-large:hover {
    border-color: #007e80;
}

.mode-icon-large {
    font-size: 2rem;
}

.mode-info {
    flex: 1;
}

.mode-name-large {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
}

.mode-desc-large {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

.mode-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-badge.safe {
    background: rgba(14, 203, 129, 0.15);
    color: #0ecb81;
}

.mode-badge.danger {
    background: rgba(246, 70, 93, 0.15);
    color: #ff6b81;
}

/* Mode Warning */
.mode-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid rgba(246, 70, 93, 0.2);
    border-radius: 10px;
    margin-top: 1rem;
}

.mode-warning .warning-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mode-warning p {
    margin: 0;
    font-size: 0.85rem;
    color: #ff6b81;
    line-height: 1.5;
}

/* API Info Box */
.api-info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.api-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.api-info-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.api-info-item .label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.api-info-item .value {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    font-family: 'Monaco', 'Consolas', monospace;
}

.api-info-item .value.verified {
    color: #0ecb81;
}

.api-info-item .value.warning {
    color: #007e80;
}

/* API Help Section */
.api-help {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.api-help h4 {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.help-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.help-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-tab:hover {
    background: rgba(255, 255, 255, 0.06);
}

.help-tab.active {
    background: rgba(0, 126, 128, 0.1);
    border-color: rgba(0, 126, 128, 0.2);
    color: #007e80;
}

.help-content ol {
    margin: 0;
    padding-left: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.8;
}

.help-content a {
    color: #007e80;
    text-decoration: none;
}

.help-content a:hover {
    text-decoration: underline;
}

.security-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 126, 128, 0.08);
    border: 1px solid rgba(0, 126, 128, 0.15);
    border-radius: 8px;
    margin-top: 1rem;
}

.security-warning span {
    font-size: 1.25rem;
}

.security-warning p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Account Stats */
.account-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.account-stats .stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.account-stats .stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.account-stats .stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.account-stats .stat-value.verified {
    color: #0ecb81;
}

.account-stats .stat-value.warning {
    color: #007e80;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.user-avatar {
    font-size: 1.25rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
}

.user-mode-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-mode-badge.demo {
    background: rgba(14, 203, 129, 0.15);
    color: #0ecb81;
}

.user-mode-badge.real {
    background: rgba(246, 70, 93, 0.15);
    color: #ff6b81;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 180px;
    background: rgba(16, 21, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.dropdown-item.logout-btn:hover {
    background: rgba(246, 70, 93, 0.15);
    color: #ff6b81;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(16, 21, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: toastSlideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-fade-out {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: #ffffff;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: #ffffff;
}

.toast-success {
    border-color: rgba(14, 203, 129, 0.3);
    background: linear-gradient(135deg, 
        rgba(14, 203, 129, 0.1) 0%,
        rgba(16, 21, 30, 0.98) 100%
    );
}

.toast-error {
    border-color: rgba(246, 70, 93, 0.3);
    background: linear-gradient(135deg, 
        rgba(246, 70, 93, 0.1) 0%,
        rgba(16, 21, 30, 0.98) 100%
    );
}

.toast-warning {
    border-color: rgba(0, 126, 128, 0.2);
    background: linear-gradient(135deg, 
        rgba(0, 126, 128, 0.08) 0%,
        rgba(16, 21, 30, 0.98) 100%
    );
}

.toast-info {
    border-color: rgba(30, 154, 245, 0.3);
    background: linear-gradient(135deg, 
        rgba(30, 154, 245, 0.1) 0%,
        rgba(16, 21, 30, 0.98) 100%
    );
}

/* Particles - Dark Theme */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 126, 128, 0.25);
    border-radius: 50%;
    animation: particleFloat 20s infinite linear;
    box-shadow: 0 0 6px rgba(0, 126, 128, 0.15);
}

.particle:nth-child(odd) {
    width: 1.5px;
    height: 1.5px;
    animation-duration: 28s;
    background: rgba(252, 213, 53, 0.15);
}

.particle:nth-child(3n) {
    width: 3px;
    height: 3px;
    background: rgba(0, 126, 128, 0.12);
    box-shadow: 0 0 10px rgba(0, 126, 128, 0.1);
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    8% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
    92% {
        opacity: 0.6;
    }
    100% {
        transform: translate(80px, -100vh) rotate(540deg);
        opacity: 0;
    }
}

/* Auth card entrance */
.auth-card {
    animation: authCardEnter 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Feature items stagger entrance */
.feature-item {
    animation: featureSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.feature-item:nth-child(1) { animation-delay: 0.6s; }
.feature-item:nth-child(2) { animation-delay: 0.75s; }
.feature-item:nth-child(3) { animation-delay: 0.9s; }

@keyframes featureSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input focus animation */
.input-wrapper input:focus {
    border-color: rgba(0, 126, 128, 0.35) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 0 0 3px rgba(0, 126, 128, 0.08),
                0 0 20px rgba(0, 126, 128, 0.04) !important;
}

/* Submit button glow animation */
.btn-glow {
    transition: box-shadow 0.4s ease, transform 0.2s ease;
}

.btn-glow:hover {
    box-shadow: 0 4px 20px rgba(0, 126, 128, 0.2),
                0 0 40px rgba(0, 126, 128, 0.06);
    transform: translateY(-1px);
    border-color: rgba(0, 126, 128, 0.3);
}

.btn-glow:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-card.account-info-card {
        grid-column: span 1;
    }
    
    .account-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .trading-mode-selector {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-features {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .settings-view {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .account-stats {
        grid-template-columns: 1fr;
    }
}
