* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Logo Styles */
.logo {
    display: block;
    margin: 0 auto 20px auto;
    width: 150px;
    height: auto;
}

.clickable-logo {
    cursor: pointer;
}

.clickable-logo:hover {
    opacity: 0.8;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 5px;
    color: #00d9ff;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 100%;
    border: 1px solid #2a2a4a;
}

/* Onboarding Modal */
.onboarding-modal {
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.onboarding-lang-selector {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #2a2a4a;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: background 0.3s;
}

.onboarding-lang-selector:hover {
    background: #3a3a5a;
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.onboarding-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2a2a4a;
}

.onboarding-dot.active {
    background: #00d9ff;
}

.onboarding-tab {
    display: none;
    flex: 1;
    flex-direction: column;
    justify-content: center;
}

.onboarding-tab.active {
    display: flex;
}

.tab-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.onboarding-tab h2 {
    color: #00d9ff;
    font-size: 24px;
    margin-bottom: 16px;
}

.onboarding-tab p {
    color: #ccc;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.onboarding-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.onboarding-nav button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

#onboarding-prev {
    background: #2a2a4a;
    color: #888;
    visibility: hidden;
}

#onboarding-next {
    background: #00d9ff;
    color: #1a1a2e;
    font-weight: 600;
}

#onboarding-next.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timer-text {
    color: #666;
    font-size: 12px;
    margin-top: 12px;
}

.skip-btn {
    color: #555;
    font-size: 11px;
    cursor: pointer;
    margin-top: 6px;
    display: none;
}

.skip-btn:hover {
    color: #888;
}

/* Password Reset Modal */
.reset-modal {
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.reset-modal h2 {
    color: #00d9ff;
    margin-bottom: 8px;
}

.reset-modal > p {
    color: #888;
    margin-bottom: 20px;
}

.reset-modal input {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #2a2a4a;
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
}

.reset-status {
    font-size: 14px;
    margin-bottom: 12px;
}

.reset-status.error {
    color: #ff6b6b;
}

.reset-status.success {
    color: #51cf66;
}

.cancel-link {
    color: #888;
    cursor: pointer;
    margin-top: 12px;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input, select {
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: #2a2a4a;
    color: #fff;
    font-size: 1rem;
}

input::placeholder {
    color: #666;
}

input:focus {
    outline: 2px solid #00d9ff;
}

button, .primary-btn {
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: #00d9ff;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

button:active {
    transform: scale(0.98);
}

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

/* Register button - same style but different color */
.register-btn {
    background: #2a2a4a !important;
    color: #00d9ff !important;
    border: 1px solid #00d9ff !important;
}

.register-btn:hover {
    background: #3a3a5a !important;
}

.hidden {
    display: none !important;
}

.error {
    color: #ff6b6b;
    font-size: 0.9rem;
    text-align: center;
}

.success {
    color: #51cf66;
    font-size: 0.9rem;
    text-align: center;
}

.switch-text {
    text-align: center;
    margin-top: 20px;
    color: #888;
}

.switch-text a {
    color: #00d9ff;
    text-decoration: none;
}

.forgot-link {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 8px;
}

.forgot-link a {
    color: #888;
    text-decoration: none;
    font-size: 13px;
}

.help-link {
    text-align: center;
    margin-top: 15px;
}

.help-link a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links {
    text-align: center;
    margin-top: 40px;
    color: #666;
    font-size: 12px;
}

.footer-links.dashboard-footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #2a2a4a;
}

.footer-links a {
    color: #666;
    text-decoration: none;
}

.footer-links span {
    margin: 0 8px;
}

/* Role Cards */
.role-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.role-card {
    background: #2a2a4a;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.role-card:hover {
    border-color: #00d9ff;
    transform: translateY(-2px);
}

.role-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.role-card h3 {
    color: #00d9ff;
    margin-bottom: 8px;
}

.role-card p {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.logout-btn {
    padding: 8px 16px;
    background: #ff6b6b;
    font-size: 0.9rem;
}

/* Welcome Card */
.welcome-card {
    background: #2a2a4a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.role-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-badge.guardian {
    background: #9775fa;
    color: #fff;
}

.role-badge.user {
    background: #00d9ff;
    color: #1a1a2e;
}

/* Cards */
.card {
    background: #2a2a4a;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.card h3 {
    color: #00d9ff;
    margin: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.card-header:hover {
    background: rgba(255,255,255,0.05);
}

.collapse-icon {
    color: #888;
    font-size: 12px;
    transition: transform 0.3s;
}

.card-content {
    padding: 0 20px 20px 20px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
}

.card-content.collapsed {
    max-height: 0;
    padding: 0 20px;
}

.subtle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.loading-text {
    color: #666;
    font-size: 0.9rem;
}

/* Section Title */
.section-title {
    color: #00d9ff;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* Code Forms */
.code-form {
    display: flex;
    gap: 10px;
}

.code-form input {
    flex: 1;
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 4px;
}

.code-form button {
    padding: 15px 25px;
}

/* Code Display */
.code-display {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    margin-top: 15px;
}

.tap-hint {
    color: #666;
    font-size: 11px;
    margin-bottom: 4px;
}

.refresh-hint {
    color: #ffd43b;
    font-size: 11px;
    margin-top: 12px;
}

.code-display .code {
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 8px;
    color: #51cf66;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
}

.code-display .code:hover {
    background: rgba(81, 207, 102, 0.1);
    border-radius: 8px;
}

.code-display .expires {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.copy-btn, .share-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    background: #2a2a4a;
    color: #fff;
    margin: 4px;
}

/* Linked User Card */
.linked-user-card {
    background: #2a2a4a;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.user-header-collapsible {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-header-collapsible:hover {
    background: #3a3a5a;
}

.user-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.user-icon {
    font-size: 20px;
    margin-right: 12px;
}

.user-name {
    flex: 1;
    font-size: 18px;
    color: #fff;
}

.total-unlock-time {
    color: #888;
    font-size: 12px;
    margin-right: 12px;
}

.expand-arrow {
    color: #00d9ff;
    font-size: 14px;
}

.user-content {
    padding: 0 20px 20px 20px;
}

.user-content.collapsed {
    display: none;
}

.unlink-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.blocked-apps-header {
    margin-bottom: 16px;
}

.section-subtitle {
    color: #888;
    font-size: 11px;
    margin-top: 2px;
}

.alerts-container {
    margin-bottom: 12px;
    max-height: 120px;
    overflow-y: auto;
}

.alert-warning {
    color: #ff6b6b;
    font-size: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a4a;
}

.alert-warning:last-child {
    border-bottom: none;
}

.unlink-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
}

.user-apps-container {
    padding-top: 16px;
}

.settings-code-section {
    margin-top: 16px;
}

.section-label {
    color: #00d9ff;
    font-size: 14px;
    margin-bottom: 8px;
}

.secondary-btn {
    padding: 10px 16px;
    background: #2a2a4a;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.secondary-btn:hover {
    background: #3a3a5a;
}

.settings-code-display {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-top: 12px;
}

.settings-code-display .code {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 6px;
    color: #51cf66;
    cursor: pointer;
    padding: 8px;
}

.settings-code-display .expires {
    color: #888;
    font-size: 11px;
    margin-top: 4px;
}

.divider {
    height: 1px;
    background: #3a3a5a;
    margin: 20px 0;
}

/* Protection Status */
.protection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 16px;
}

.status-indicator {
    font-size: 18px;
}

.status-text {
    font-size: 14px;
    color: #888;
}

.status-text.active {
    color: #51cf66;
}

.status-text.warning {
    color: #ff6b6b;
    font-weight: 600;
}

/* Guardian Card */
.guardian-card {
    background: #2a2a4a;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.guardian-icon {
    font-size: 24px;
    margin-right: 12px;
}

.guardian-name {
    flex: 1;
    font-size: 16px;
    color: #fff;
}

.upgrade-hint {
    color: #ffd43b;
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
}

/* App Cards */
.app-card {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.app-name {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.app-status {
    font-size: 0.9rem;
}

.app-status.locked {
    color: #ff6b6b;
}

.app-status.unlocked {
    color: #51cf66;
}

.lock-status {
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.lock-status.locked {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.lock-status.unlocked {
    color: #51cf66;
    background: rgba(81, 207, 102, 0.1);
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.app-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.app-controls select {
    padding: 10px;
    flex: 1;
}

.app-controls button {
    padding: 10px 15px;
    font-size: 0.9rem;
}

.app-code-display {
    background: #2a2a4a;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-top: 12px;
}

.app-code-display .code {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 6px;
    color: #51cf66;
    cursor: pointer;
}

.app-code-display .expires {
    color: #888;
    font-size: 0.85rem;
    margin-top: 5px;
}

.code-buttons {
    margin-top: 10px;
}

/* User app unlock form */
.app-unlock-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.app-unlock-form input {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 3px;
}

.app-unlock-form button {
    padding: 10px 15px;
    font-size: 0.9rem;
}

.app-unlock-status {
    margin-top: 8px;
    font-size: 0.85rem;
    text-align: center;
}

.app-unlock-status.error {
    color: #ff6b6b;
}

.app-unlock-status.success {
    color: #51cf66;
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #ff6b6b;
    color: #fff;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Button Error Flash */
.btn-error-flash {
    animation: errorFlash 1s ease;
}

@keyframes errorFlash {
    0%, 100% {
        background: #00d9ff;
    }
    25%, 75% {
        background: #ff6b6b;
    }
    50% {
        background: #ff4444;
    }
}

/* Language Selector */
.language-selector {
    text-align: center;
    margin-top: 16px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.language-selector:hover {
    background: rgba(255, 255, 255, 0.05);
}

.language-selector.dashboard-lang {
    margin-top: 12px;
}

.language-modal {
    text-align: center;
}

.language-modal h2 {
    color: #00d9ff;
    margin-bottom: 24px;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: #2a2a4a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.language-option:hover {
    background: #3a3a5a;
    transform: translateY(-1px);
}

.language-option .flag {
    font-size: 24px;
}

.language-option .lang-text {
    color: #fff;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 400px) {
    .code-form, .app-controls, .app-unlock-form {
        flex-direction: column;
    }

    .code-form button, .app-controls button, .app-unlock-form button {
        width: 100%;
    }

    .code-display .code {
        font-size: 2rem;
        letter-spacing: 5px;
    }

    .onboarding-tab p {
        font-size: 14px;
    }

    .logo {
        width: 120px;
    }
}
