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

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   PAGE 1: FORM
========================================== */
#page1 {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.form-wrapper {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    max-height: 100vh;
    overflow-y: auto;
}

.form-card {
    background: #ffffff;
    border: 3px solid #000000;
    padding: 40px 30px;
    max-height: 90vh;
    overflow-y: auto;
}

.form-card h1 {
    color: #000000;
    font-size: 2em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
}

.form-card .subtitle {
    color: #666666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.pfp-group {
    margin-bottom: 25px;
}

.pfp-upload-container {
    display: flex;
    justify-content: center;
}

.pfp-preview {
    width: 150px;
    height: 150px;
    border: 3px solid #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pfp-preview:hover {
    border-color: #333333;
    transform: scale(1.05);
}

.pfp-placeholder {
    text-align: center;
    font-size: 0.85em;
    color: #666666;
    padding: 20px;
    font-weight: 600;
}

.pfp-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: #000000;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #000000;
    background: #ffffff;
    color: #000000;
    font-size: 1em;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #333333;
}

.btn-generate {
    width: 100%;
    padding: 15px;
    background: #000000;
    color: #ffffff;
    border: none;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn-generate:hover {
    background: #333333;
}

/* ==========================================
   PAGE 2: TERMINAL
========================================== */
#page2 {
    background: linear-gradient(135deg,
        #f5d4e8 0%,
        #e8b4d4 25%,
        #d893c3 50%,
        #a86b94 75%,
        #8b5678 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.terminal-wrapper {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.terminal-card {
    background: linear-gradient(135deg, #2d2a35 0%, #1a1820 60%, #0f0e12 100%);
    border: 1px solid rgba(232, 180, 212, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.terminal-header {
    background: linear-gradient(135deg, rgba(232, 180, 212, 0.3) 0%, rgba(168, 107, 148, 0.3) 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(232, 180, 212, 0.3);
}

.header-left {
    display: flex;
    gap: 8px;
}

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

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.header-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    color: #e8b4d4;
    flex: 1;
    text-align: center;
}

.header-right {
    display: flex;
    gap: 12px;
    color: #d893c3;
    font-size: 0.9em;
}

.terminal-body {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.terminal-line {
    opacity: 0;
    animation: lineAppear 0.1s ease forwards;
    margin-bottom: 6px;
    padding: 0 25px;
    font-family: 'Fira Code', monospace;
    font-size: 0.95em;
    line-height: 1.7;
    color: #d4d4d4;
}

.terminal-line:first-child {
    padding-top: 25px;
}

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

.comment { color: #6a9955; font-style: italic; }
.keyword { color: #c586c0; font-weight: 600; }
.function { color: #dcdcaa; }
.string { color: #ce9178; }
.variable { color: #9cdcfe; }
.success { color: #4ec9b0; }

.pfp-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: pfpReveal 1s ease forwards;
    overflow: hidden;
}

@keyframes pfpReveal {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.pfp-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.code-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.code-canvas {
    width: 100%;
    height: 100%;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    opacity: 0;
    animation: controlsAppear 0.6s ease 12s forwards;
}

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

.btn-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: 2px solid rgba(232, 180, 212, 0.3);
    background: rgba(31, 31, 31, 0.9);
    backdrop-filter: blur(10px);
    color: #d4d4d4;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-control:hover {
    border-color: #e8b4d4;
    background: rgba(232, 180, 212, 0.2);
    transform: translateY(-2px);
}

/* ==========================================
   PAGE 2: RECORDING
========================================== */
#page2 {
    background: linear-gradient(135deg,
        #f5d4e8 0%,
        #e8b4d4 25%,
        #d893c3 50%,
        #a86b94 75%,
        #8b5678 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.recording-wrapper {
    text-align: center;
    padding: 40px;
}

.status-text {
    font-size: 2em;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, #e8b4d4);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.download-section {
    margin-top: 40px;
    text-align: center;
}

.btn-download-main {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.98);
    color: #8b5678;
    border: none;
    padding: 25px 50px;
    font-size: 1.3em;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    font-family: 'Inter', sans-serif;
}

.btn-download-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    background: #ffffff;
}

.btn-download-main svg {
    width: 32px;
    height: 32px;
}

.help-text {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.help-text p {
    color: #ffffff;
    font-size: 0.95em;
    margin: 10px 0;
    line-height: 1.6;
}

.help-text a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 600;
}

.help-text a:hover {
    color: #e8b4d4;
}

/* ==========================================
   RESPONSIVE
========================================== */
@media (max-width: 768px) {
    .form-card { padding: 30px 20px; }
    .pfp-preview { width: 120px; height: 120px; }
    .terminal-body { height: 400px; }
    .controls { flex-direction: column; gap: 10px; }
    .btn-control { width: 100%; }
}

@media (max-width: 480px) {
    .form-card h1 { font-size: 1.6em; }
}
