* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
    min-height: 100vh;
    transition: background 0.3s;
}

body.dark {
    background: linear-gradient(to bottom, #000000, #18181b);
}

.container {
    max-width: 28rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
}

body.dark h1 {
    color: #fff;
}

h1 .highlight {
    color: #FFFC00;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.privacy-link {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

body.dark .privacy-link {
    color: #9ca3af;
}

.privacy-link:hover {
    color: #000;
}

body.dark .privacy-link:hover {
    color: #fff;
}

.theme-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Connection Form */
.connection-card {
    backdrop-filter: blur(16px);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.05);
}

body.dark .connection-card {
    background: rgba(255, 255, 255, 0.05);
}

.form-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: rgba(0, 0, 0, 0.8);
}

body.dark .form-title {
    color: rgba(255, 255, 255, 0.8);
}

.form-group {
    display: flex;
    gap: 0.5rem;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

input {
    width: 100%;
    height: 3rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    color: #000;
    outline: none;
    transition: border 0.2s;
}

body.dark input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

input.valid { border-color: rgba(34, 197, 94, 0.5); }
input.invalid { border-color: rgba(239, 68, 68, 0.5); }
input:disabled { cursor: not-allowed; }

.input-icon {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
}

.icon-valid { color: #22c55e; }
.icon-invalid { color: #ef4444; }

.btn {
    min-width: 100px;
    height: 3rem;
    padding: 0 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: #FFFC00;
    color: #000;
}

.btn-primary:hover:not(:disabled) {
    background: rgba(255, 252, 0, 0.9);
}

.btn-disconnect {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.btn-disconnect:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error-message {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #ef4444;
}

.connection-status {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #22c55e;
}

.status-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background: #22c55e;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

/* Feature Cards */
.features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-card {
    width: 100%;
    text-align: left;
    padding: 0.875rem;
    border-radius: 0.75rem;
    border: 0.25px solid rgba(255, 252, 0, 0.2);
    background: rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s;
}

body.dark .feature-card {
    background: rgba(255, 255, 255, 0.05);
}

.feature-card:hover:not(.disabled) {
    transform: scale(1.02);
    border-color: rgba(255, 252, 0, 0.4);
    box-shadow: 0 10px 15px -3px rgba(255, 252, 0, 0.05);
}

.feature-card.disabled {
    cursor: not-allowed;
}

.feature-content {
    display: flex;
    align-items: center;
}

.feature-emoji {
    font-size: 2rem;
    margin-right: 0.75rem;
    transition: transform 0.3s;
}

.feature-card:hover .feature-emoji {
    transform: scale(1.1);
}

.feature-info {
    flex: 1;
}

.feature-title {
    font-weight: 500;
    font-size: 0.875rem;
    color: #000;
    margin-bottom: 0.125rem;
}

body.dark .feature-title {
    color: #fff;
}

.feature-description {
    font-size: 0.75rem;
    color: #9ca3af;
}

.feature-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
    transition: all 0.3s;
}

.feature-card:hover .feature-arrow {
    transform: translateX(0.25rem);
    color: #FFFC00;
}

body.dark .feature-card:hover .feature-arrow {
    color: #FFFC00;
}

/* ==================== MODAL ==================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 32rem;
    border-radius: 32px 32px 0 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

body.dark .modal-content {
    background: #18181b;
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-handle {
    width: 3rem;
    height: 0.375rem;
    background: rgba(209, 213, 219, 0.2);
    border-radius: 9999px;
    margin: 0.75rem auto;
}

.modal-body {
    padding: 0 1rem 1.5rem;
}

.modal-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #000;
}

body.dark .modal-title {
    color: #fff;
}

.reveal-btn {
    width: 100%;
    max-width: 24rem;
    background: #FFFC00;
    color: #000;
    padding: 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    margin: 0 auto;
    display: block;
    transition: all 0.3s;
}

.reveal-btn:hover {
    background: rgba(255, 252, 0, 0.9);
}

/* ==================== IMPROVED PROGRESS SECTION ==================== */

.progress-container {
    padding: 2rem 1.5rem;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(0, 0, 0, 0.95));
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 252, 0, 0.25);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
}

.progress-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #FFFC00;
    border-radius: 9999px;
    margin-right: 0.75rem;
    animation: pulse 2s infinite;
}

.progress-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFFC00;
    text-shadow: 0 0 8px rgba(255, 252, 0, 0.3);
}

.progress-bar-bg {
    height: 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #FFFC00, #facc15);
    border-radius: 9999px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 15px rgba(255, 252, 0, 0.7),
                0 0 25px rgba(255, 252, 0, 0.4);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-message {
    font-size: 0.95rem;
    font-weight: 500;
    color: #e5e7eb;           /* Much more readable */
    flex: 1;
}

.progress-percent {
    font-size: 1rem;
    font-weight: 700;
    color: #FFFC00;
    text-shadow: 0 0 8px rgba(255, 252, 0, 0.5);
}

/* Verification Section */
.verification-container {
    max-width: 24rem;
    margin: 0 auto;
}

.verification-icon {
    padding: 1rem;
    border-radius: 9999px;
    background: rgba(255, 252, 0, 0.1);
    width: fit-content;
    margin: 0 auto 1.5rem;
}

.verification-icon svg {
    width: 2.5rem;
    height: 2.5rem;
    color: #FFFC00;
}

.verification-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 0.75rem;
    background: rgba(255, 252, 0, 0.1);
}

.verification-notice svg {
    width: 1rem;
    height: 1rem;
    color: #FFFC00;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Privacy Modal */
.privacy-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.privacy-modal.active {
    display: flex;
}

.privacy-content {
    width: 100%;
    max-width: 42rem;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark .privacy-content {
    background: #000;
    border-color: rgba(255, 255, 255, 0.1);
}

.privacy-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 252, 0, 0.2);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.privacy-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
}

body.dark .privacy-header h2 {
    color: #fff;
}

.close-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dark .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #000;
}

body.dark .close-btn svg {
    color: #fff;
}

.privacy-body {
    padding: 1.5rem;
}

.privacy-section {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
}

body.dark .privacy-section {
    background: rgba(255, 255, 255, 0.05);
}

.privacy-section:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.dark .privacy-section:hover {
    background: rgba(255, 255, 255, 0.1);
}

.privacy-section h3 {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #000;
}

body.dark .privacy-section h3 {
    color: #fff;
}

.privacy-section p {
    font-size: 0.875rem;
    color: #374151;
}

body.dark .privacy-section p {
    color: #d1d5db;
}

.disclaimer {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

body.dark .disclaimer {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #000;
    border-top-color: transparent;
    border-radius: 9999px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Mobile Only Message */
.mobile-only-message {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.mobile-message-card {
    max-width: 28rem;
    width: 100%;
    padding: 2rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

body.dark .mobile-message-card {
    background: #18181b;
}

.mobile-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.mobile-icon-bg {
    padding: 1rem;
    border-radius: 9999px;
    background: rgba(255, 252, 0, 0.2);
}

body.dark .mobile-icon-bg {
    background: rgba(255, 252, 0, 0.1);
}

.mobile-icon svg {
    width: 3rem;
    height: 3rem;
    color: #FFFC00;
}

.mobile-message-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #000;
}

body.dark .mobile-message-title {
    color: #fff;
}

.mobile-message-text {
    font-size: 1.125rem;
    color: #6b7280;
}

body.dark .mobile-message-text {
    color: #d1d5db;
}

@media (min-width: 768px) {
    .mobile-only-message {
        display: flex !important;
    }
    .app-content {
        display: none !important;
    }
}