/* ===================================
   ORDYNAIRE - Base Components
   Foundation, Variables & Shared Elements
   Mobile-First with Desktop Responsiveness
   =================================== */

/* CSS Variables */
:root {
    --primary-accent: #707070;
    --accent-subtle: rgba(112, 112, 112, 0.15);
    --white: #fff;
    --near-white: rgba(255, 255, 255, 0.95);
    --soft-white: rgba(255, 255, 255, 0.7);
    --fingerprint-gray: rgba(255, 255, 255, 0.6);
    --glow-soft: rgba(255, 255, 255, 0.08);
    --glow-ring: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --steel-grey: #71797E;
    --ai-blue: #00A3FF;
    --ai-blue-soft: rgba(0, 163, 255, 0.7);
    --ai-blue-glow: rgba(0, 163, 255, 0.3);
    --page-bg: #000;
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    --shadow-sm: 0 0 8px rgba(255, 255, 255, 0.02);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
    --error-red: #f44;
    --success-green: #0f8;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

*:focus,
button,
input,
select,
textarea {
    outline: none;
}

html,
body {
    width: 100%;
    height: 100%;
    background: var(--page-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--white);
    overflow: hidden;
}

body {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

body.choicedsd-active {
    overflow-y: auto !important;
    height: auto !important;
}

body.choicedsd-active html {
    overflow: auto !important;
}

/* Page Structure */
.page {
    position: fixed;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease-out), visibility 0.5s;
    z-index: 1;
    background: var(--page-bg);
    color: var(--white);
}

.page.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

body.choicedsd-active #choicedsdPage {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.choicedsd-active .page:not(#choicedsdPage) {
    display: none;
}

/* Shared Components */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transform: translateZ(0);
}

.hover-lift {
    transition: all 0.4s var(--ease-out);
}

/* Mobile: touch interactions */
.hover-lift:active {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 40px var(--accent-subtle);
}

/* Desktop: hover interactions */
@media (min-width: 1024px) {
    .hover-lift:hover {
        transform: translateY(-10px) scale(1.02);
        box-shadow: var(--shadow-lg), 0 0 40px var(--accent-subtle);
    }
    
    .hover-lift:active {
        transform: translateY(-8px) scale(1.01);
    }
}

.btn {
    display: inline-block;
    padding: 14px 40px;
    background: var(--glass-bg);
    color: var(--white);
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.05rem;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    transform: translateZ(0);
}

/* Mobile: active state */
.btn:active {
    border-color: var(--soft-white);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.05);
}

/* Desktop: hover + active states */
@media (min-width: 1024px) {
    .btn {
        padding: 16px 48px;
        font-size: 0.9rem;
    }
    
    .btn:hover {
        border-color: var(--soft-white);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.08);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* Authentication Modals */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.4s var(--ease-out);
    position: relative;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .auth-modal {
        padding: 40px 36px;
        max-width: 500px;
        border-radius: 20px;
    }
}

@media (min-width: 1024px) {
    .auth-modal {
        padding: 48px 40px;
        max-width: 540px;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }
}

.auth-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

/* Mobile: active state */
.auth-close:active {
    background: var(--glow-soft);
    border-color: var(--soft-white);
}

/* Desktop: hover state */
@media (min-width: 1024px) {
    .auth-close {
        width: 40px;
        height: 40px;
    }
    
    .auth-close:hover {
        background: var(--glow-soft);
        border-color: var(--soft-white);
        transform: rotate(90deg);
    }
    
    .auth-close:active {
        transform: rotate(90deg) scale(0.95);
    }
}

.auth-close::before,
.auth-close::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: var(--soft-white);
    border-radius: 2px;
}

.auth-close::before {
    transform: rotate(45deg);
}

.auth-close::after {
    transform: rotate(-45deg);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

@media (min-width: 1024px) {
    .auth-header {
        margin-bottom: 40px;
    }
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.15rem;
    margin-bottom: 8px;
    color: var(--white);
}

@media (min-width: 768px) {
    .auth-title {
        font-size: 1.8rem;
        letter-spacing: 0.2rem;
    }
}

@media (min-width: 1024px) {
    .auth-title {
        font-size: 2rem;
        letter-spacing: 0.25rem;
        margin-bottom: 12px;
    }
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--soft-white);
    letter-spacing: 0.08rem;
}

@media (min-width: 768px) {
    .auth-subtitle {
        font-size: 0.95rem;
        letter-spacing: 0.1rem;
    }
}

@media (min-width: 1024px) {
    .auth-subtitle {
        font-size: 1rem;
        letter-spacing: 0.12rem;
    }
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .auth-tabs {
        margin-bottom: 36px;
        border-radius: 10px;
    }
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--soft-white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05rem;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .auth-tab {
        padding: 14px;
        font-size: 0.95rem;
    }
    
    .auth-tab:hover:not(.active) {
        background: rgba(255, 255, 255, 0.05);
    }
}

@media (min-width: 1024px) {
    .auth-tab {
        padding: 16px;
        font-size: 1rem;
        letter-spacing: 0.08rem;
    }
}

.auth-tab.active {
    background: var(--white);
    color: var(--page-bg);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .auth-form {
        gap: 24px;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 1024px) {
    .form-group {
        gap: 10px;
    }
}

.form-label {
    font-size: 0.8rem;
    color: var(--soft-white);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    font-weight: 500;
}

@media (min-width: 1024px) {
    .form-label {
        font-size: 0.85rem;
        letter-spacing: 0.12rem;
    }
}

.form-input {
    background: var(--glow-soft);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--white);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .form-input {
        padding: 16px 18px;
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .form-input {
        padding: 16px 20px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .form-input:hover {
        border-color: rgba(255, 255, 255, 0.2);
    }
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-input:focus {
    border-color: var(--ai-blue);
    box-shadow: 0 0 0 3px var(--ai-blue-glow);
    background: rgba(255, 255, 255, 0.1);
}

.auth-button {
    background: linear-gradient(135deg, var(--ai-blue) 0%, var(--ai-blue-soft) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    box-shadow: 0 0 20px var(--ai-blue-glow);
}

@media (min-width: 768px) {
    .auth-button {
        padding: 18px;
        font-size: 1rem;
    }
    
    .auth-button:hover:not(:disabled) {
        background: linear-gradient(135deg, var(--ai-blue) 0%, var(--ai-blue) 100%);
        box-shadow: 0 0 30px var(--ai-blue-glow);
        transform: translateY(-2px);
    }
}

@media (min-width: 1024px) {
    .auth-button {
        padding: 18px;
        font-size: 1.05rem;
        border-radius: 10px;
        margin-top: 12px;
    }
}

.auth-button:active:not(:disabled) {
    background: linear-gradient(135deg, var(--ai-blue) 0%, var(--ai-blue) 100%);
    box-shadow: 0 0 30px var(--ai-blue-glow);
}

@media (min-width: 1024px) {
    .auth-button:active:not(:disabled) {
        transform: translateY(0);
    }
}

.auth-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-message {
    text-align: center;
    font-size: 0.85rem;
    padding: 12px;
    border-radius: 6px;
    margin-top: 8px;
}

@media (min-width: 768px) {
    .auth-message {
        font-size: 0.9rem;
        padding: 14px;
    }
}

@media (min-width: 1024px) {
    .auth-message {
        font-size: 0.95rem;
        padding: 16px;
        border-radius: 8px;
    }
}

.auth-message.error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: var(--error-red);
}

.auth-message.success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--success-green);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInY {
    to { opacity: 0.4; }
}

@keyframes pulse-ring {
    0%, 100% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

@keyframes symbol-pulse {
    0%, 100% {
        box-shadow: 0 0 45px rgba(255, 255, 255, 0.15),
                    inset 0 0 35px rgba(255, 255, 255, 0.07),
                    0 0 80px rgba(255, 255, 255, 0.12);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 255, 255, 0.22),
                    inset 0 0 45px rgba(255, 255, 255, 0.1),
                    0 0 100px rgba(255, 255, 255, 0.18);
    }
}

@keyframes fingerprint-glow {
    0% {
        filter: brightness(0) invert(1) drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
    }
    100% {
        filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
    }
}

@keyframes scan-sweep {
    0% {
        top: 0%;
        opacity: 0;
    }
    10%, 90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

@keyframes neuron-fire {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.8);
        opacity: 1;
    }
}

@keyframes signal-flow {
    0% {
        opacity: 0;
        background: linear-gradient(90deg, var(--ai-blue-soft) 0%, transparent 20%, transparent 100%);
    }
    50% {
        opacity: 1;
        background: linear-gradient(90deg, transparent 0%, var(--ai-blue) 50%, transparent 100%);
    }
    100% {
        opacity: 0;
        background: linear-gradient(90deg, transparent 0%, transparent 80%, var(--ai-blue-soft) 100%);
    }
}

@keyframes connection-pulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

@keyframes loading1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes loading2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

@keyframes loading3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}
