@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #0d0d0d; /* Slightly lighter black for body */
    --text-color: #ffffff;
    --light-gray-text: #8e8e93;
    --card-bg: #1c1c1e;
    --primary-blue: #0a84ff; /* Based on the phone button color */
    --primary-green: #38c172; /* Green color for enabled button */
    --accent-green-blue: #2ecc71; /* Greenish part of icon gradient */
    --accent-blue: #3498db; /* Bluish part of icon gradient */
    --input-bg: #2c2c2e;
    --border-color: rgba(255, 255, 255, 0.1);
    --button-disabled-bg: #333333; /* Darker gray for disabled continue button */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 375px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    position: relative;
}

/* Header (Facetroid logo) */
.header {
    width: 100%;
    text-align: left;
    padding: 20px 20px 0;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

/* Page Control: All pages take up full container space */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 100px 20px 20px;
    box-sizing: border-box;
    justify-content: flex-start;
}

/* Only Page 1 will be visible on load */
#page-1 {
    display: flex;
    padding-top: 100px;
    justify-content: flex-start;
}

/* Content Area (Shared Styles) */
.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 335px;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green-blue), var(--accent-blue));
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.link-icon {
    color: var(--text-color);
    font-size: 38px;
}

.title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.subtitle {
    font-size: 15px;
    color: var(--light-gray-text);
    margin: 0 0 40px 0;
}

/* Form Card (Page 1 specific styling for LP01 match) */
.form-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 0;
}

.toggle-buttons {
    display: flex;
    background-color: var(--input-bg);
    border-radius: 9px;
    padding: 4px;
    width: fit-content;
    margin: 0 auto 10px auto;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--light-gray-text);
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.toggle-btn.active {
    background-color: var(--primary-blue);
    color: var(--text-color);
}

.toggle-btn i {
    font-size: 16px;
}

/* Input Group Styling (for select and phone input) */
/* The country select dropdown and phone input are now side-by-side inside the form-card, so they need distinct styling if they are not to stack. However, based on LP01 they are stacking, so the current gap styling in form-card is fine. */
.input-group {
    background-color: var(--input-bg);
    border-radius: 9px;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 10px;
    color: var(--text-color);
    font-size: 17px;
}

.input-group.country-select {
    position: relative;
    padding-right: 40px;
    height: 48px;
}

.country-flag {
    font-weight: 500;
    color: var(--text-color);
}

.input-group select {
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 17px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 10px;
    height: 100%;
}

.input-group select option {
    background-color: var(--card-bg);
    color: var(--text-color);
}

.select-arrow {
    position: absolute;
    right: 15px;
    color: var(--light-gray-text);
    pointer-events: none;
}

.phone-prefix {
    color: var(--text-color);
    font-weight: 500;
}

.input-group input[type="text"],
.input-group input[type="email"] /* Added email input styling */
{
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 17px;
    outline: none;
    padding: 0;
    height: 100%;
}

.input-group input::placeholder {
    color: var(--light-gray-text);
}


.continue-btn {
    background-color: var(--button-disabled-bg);
    color: var(--light-gray-text);
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 17px;
    font-weight: 600;
    cursor: not-allowed;
    transition: background-color 0.2s, color 0.2s;
    width: 100%;
    margin-top: 10px;
}

.continue-btn.enabled {
    background-color: var(--primary-green);
    color: var(--text-color);
    cursor: pointer;
}

/* Footer (Privacy Policy) */
.footer {
    position: absolute;
    bottom: 25px;
    width: 100%;
    text-align: center;
}

.privacy-policy {
    color: var(--light-gray-text);
    text-decoration: none;
    font-size: 15px;
}

/* --- NEW: Page 2 (Connecting/Progress) Styles --- */
#page-2 {
    padding-top: 150px;
    justify-content: flex-start;
}

#page-2 .icon-circle {
    background-color: #2c2c2e;
    border: 1px solid #333;
    margin-bottom: 30px;
}

.connecting-text {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    margin-top: 0px;
}

.status-message {
    font-size: 15px;
    color: var(--light-gray-text);
    margin: 10px 0 0 0;
}

.progress-bar-container {
    width: 250px;
    height: 4px;
    background-color: #2c2c2e;
    border-radius: 2px;
    margin-top: 40px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-blue);
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* --- NEW: Page 3 (Device Online) Styles --- */
#page-3 {
    padding-top: 150px;
    justify-content: flex-start;
}

#page-3 .icon-circle {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    font-size: 38px;
    color: white;
    margin-bottom: 25px;
}
#page-3 .fas.fa-link {
    display: none;
}
#page-3 .fas.fa-user {
    font-size: 38px;
    color: white;
}

.live-status {
    font-size: 15px;
    color: var(--primary-green);
    margin: 10px 0 0 0;
}

.action-buttons-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 335px;
    margin-top: 40px;
}

.action-buttons-group button {
    flex-grow: 1;
    padding: 15px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-history {
    background-color: var(--primary-green);
    color: var(--text-color);
}

.btn-live {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--light-gray-text);
}

.note-text {
    font-size: 14px;
    color: var(--light-gray-text);
    margin-top: 25px;
}

.close-btn {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 17px;
    font-weight: 600;
    width: 100%;
    max-width: 335px;
    margin-top: 40px;
    cursor: pointer;
}