/* Reset et fondation */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --mr-bg: #0b0c0e;
    --term-bg: #0d1117;
    --term-header: #161b22;
    --term-text: #a9b7c6;
    --term-green: #56b6c2;
    --term-red: #e06c75;
    --term-yellow: #e5c07b;
    --term-highlight: #ff0000;
    --fs-red: #d81818;
    --fs-red-dark: #8b0000;
    --term-command: #b5cea8;
    --term-response: #808080;
    --btn-bg: #30363d;
    --link-color: #58a6ff;
    --border-color: #30363d;
    --error-color: #f85149;
    --success-color: #3fb950;
}

body {
    font-family: 'Inconsolata', monospace;
    background-color: var(--mr-bg);
    color: var(--term-text);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Glitch Overlay */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, rgba(18, 16, 16, 0.1) 50%, transparent 50%, rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    z-index: 100;
    pointer-events: none;
    opacity: 0.15;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 0 100%;
    }
}

/* Kernel Panic Animation */
.kernel-panic {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    color: white;
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
    white-space: pre-wrap;
}

.kernel-container {
    max-width: 980px;
    margin: 0 auto;
}

.kernel-text {
    line-height: 1.3;
}

.text-line {
    margin-bottom: 2px;
    animation: typeLine 0.1s steps(1, end) forwards;
    opacity: 0;
}

@keyframes typeLine {
    to {
        opacity: 1;
    }
}

/* Terminal Container */
.container {
    display: none; /* Will be shown after kernel panic */
    height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.terminal-window {
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    background-color: var(--term-bg);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Terminal Header */
.terminal-header {
    background-color: var(--term-header);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 1px solid #30363d;
}

.terminal-buttons {
    display: flex;
    gap: 6px;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-button.close {
    background-color: var(--term-red);
}

.terminal-button.minimize {
    background-color: var(--term-yellow);
}

.terminal-button.maximize {
    background-color: var(--term-green);
}

.terminal-title {
    font-size: 14px;
    color: #a9b7c6;
}

/* Terminal Body */
.terminal-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    position: relative;
}

/* Command History */
.terminal-command-history {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.command-line {
    color: var(--term-command);
    margin-bottom: 2px;
}

.command-line::before {
    content: "root@fsociety:~# ";
    color: var(--fs-red);
    font-weight: bold;
}

.response-line {
    color: var(--term-response);
    margin-bottom: 2px;
    margin-left: 15px;
}

/* App Interface */
.app-interface {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    align-items: center;
}

.glitch-logo {
    position: relative;
    margin-right: 15px;
}

.fs-logo {
    font-family: monospace;
    font-size: 8px;
    line-height: 1;
    color: var(--fs-red);
    margin: 0;
    position: relative;
}

.fso-mask {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 5px var(--fs-red);
    pointer-events: none;
}

.app-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--term-green);
    text-transform: lowercase;
    position: relative;
}

.app-title::after {
    content: "";
    position: absolute;
    top: 0;
    right: -10px;
    width: 8px;
    height: 8px;
    background-color: var(--fs-red);
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.status-bar {
    display: flex;
    gap: 15px;
}

.status-item {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-label {
    color: #808080;
}

.status-value {
    color: var(--term-yellow);
}

.status-value.connected {
    color: var(--success-color);
}

/* Main Content */
.app-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.auth-box {
    width: 100%;
    max-width: 500px;
    background-color: rgba(13, 17, 23, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 25px;
}

.system-msg {
    font-family: 'Courier Prime', monospace;
    color: var(--term-green);
    margin-bottom: 20px;
    font-size: 18px;
}

/* Tabs */
.tabs-container {
    margin-top: 15px;
}

.tab-buttons {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-family: 'Inconsolata', monospace;
    font-size: 15px;
    color: var(--term-text);
    cursor: pointer;
    position: relative;
    transition: 0.3s;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--term-green);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--fs-red);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

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

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

.form-group label {
    font-size: 14px;
    color: #808080;
}

.input-wrapper {
    position: relative;
}

.term-input {
    width: 100%;
    padding: 10px 12px;
    background-color: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--term-text);
    font-family: 'Inconsolata', monospace;
    font-size: 15px;
}

.term-input:focus {
    outline: none;
    border-color: var(--term-green);
    box-shadow: 0 0 0 1px rgba(86, 182, 194, 0.3);
}

.term-input::placeholder {
    color: #4d5566;
}

.consent-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.consent-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: rgba(13, 17, 23, 0.8);
    cursor: pointer;
    position: relative;
}

.consent-checkbox:checked::before {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--term-green);
    font-size: 12px;
}

.consent-label {
    font-size: 13px;
    color: #808080;
}

.submit-btn {
    background-color: transparent;
    border: 1px solid var(--fs-red);
    border-radius: 4px;
    padding: 10px;
    color: var(--fs-red);
    font-family: 'Inconsolata', monospace;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    text-align: center;
}

.submit-btn:hover {
    background-color: rgba(216, 24, 24, 0.1);
    color: var(--term-text);
}

.forgot-password {
    margin-top: 10px;
    text-align: center;
}

.text-link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
}

.text-link:hover {
    text-decoration: underline;
}

/* Footer */
.app-footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.terminal-prompt {
    display: flex;
    align-items: center;
    gap: 5px;
}

.prompt-sign {
    color: var(--fs-red);
    font-weight: bold;
}

.prompt-cursor {
    color: var(--term-text);
    font-weight: bold;
    animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.footer-status {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #4d5566;
}

.hash-id {
    font-family: 'Courier Prime', monospace;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(13, 17, 23, 0.95);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--term-green);
    color: var(--term-text);
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--term-yellow);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .terminal-window {
        height: 100vh;
        border-radius: 0;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .status-bar {
        width: 100%;
        justify-content: space-between;
    }

    .auth-box {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .terminal-title {
        display: none;
    }
    
    .app-title {
        font-size: 20px;
    }

    .fs-logo {
        font-size: 6px;
    }
    
    .status-item {
        font-size: 10px;
    }
    
    .status-label {
        display: none;
    }
    
    .footer-status {
        font-size: 12px;
    }
}
