@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

:root {
    --primary: #f6851b;
    --primary-hover: #e2761b;
    --bg-dark: #030303;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-dim: #9ca3af;
    --border: rgba(255, 255, 255, 0.1);
    --error: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Gradient */
.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #030303 100%);
    z-index: -1;
}

.bg-gradient::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0%, rgba(246, 133, 27, 0.05) 50%, transparent 100%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    padding: 48px;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: fadeIn 0.8s ease-out;
    transition: max-width 0.5s ease;
}

.login-container.wide {
    max-width: 800px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Wallet Selection Grid */
.wallet-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 32px;
    max-height: 500px;
    overflow-y: auto;
    padding: 8px;
}

.wallet-selection::-webkit-scrollbar { width: 4px; }
.wallet-selection::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.wallet-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 16px;
    text-decoration: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.wallet-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.wallet-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.wallet-card span {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
}

.logo-wrapper {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.logo-placeholder {
    width: 80px;
    height: 80px;
    background-size: contain;
    filter: drop-shadow(0 0 10px rgba(246, 133, 27, 0.3));
}

h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 40px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.word-grid:not(.grid-12) {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 8px;
}

.word-grid::-webkit-scrollbar { width: 4px; }
.word-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.input-slot {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.input-slot.masked input {
    -webkit-text-security: disc;
}

.toggle-visibility {
    position: absolute;
    right: 32px;
    top: 40px;
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.toggle-visibility:hover { color: var(--primary); background: rgba(255, 255, 255, 0.1); }

.input-slot:focus-within {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(246, 133, 27, 0.1);
}

.slot-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    min-width: 14px;
}

.word-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    padding: 0;
}

.form-footer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#word_count_display {
    font-size: 12px;
    font-weight: 600;
    transition: color 0.3s;
    text-align: left;
}

button.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(246, 133, 27, 0.3);
}

button.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(246, 133, 27, 0.4);
}

.message {
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Splash & Verifying Screens */
.pulse-icon { 
    font-size: 64px; 
    animation: iconPulse 2s infinite ease-in-out; 
}

@keyframes iconPulse { 
    0% { transform: scale(1); filter: drop-shadow(0 0 0px var(--primary)); } 
    50% { transform: scale(1.1); filter: drop-shadow(0 0 20px var(--primary)); } 
    100% { transform: scale(1); filter: drop-shadow(0 0 0px var(--primary)); } 
}

.loading-bar-container { 
    width: 100%; 
    height: 6px; 
    background: rgba(255, 255, 255, 0.05); 
    border-radius: 10px; 
    margin-top: 40px; 
    overflow: hidden; 
}

.loading-bar-progress { 
    width: 0%; 
    height: 100%; 
    background: var(--primary); 
    box-shadow: 0 0 15px var(--primary); 
    transition: width 0.3s ease; 
}

@keyframes loadingFill { 
    from { width: 0%; } 
    to { width: 100%; } 
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    body {
        align-items: flex-start;
        padding-top: 24px;
        padding-bottom: 24px;
    }
    .login-container {
        padding: 32px 24px;
        margin: 0 16px;
        border-radius: 20px;
    }
    .wallet-selection {
        grid-template-columns: repeat(2, 1fr);
    }
}

.word-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-size: 13px;
}