:root {
    /* Arc Inspired Colors */
    --primary-color: #FF7043;
    --primary-hover: #F4511E;
    --bg-gradient-start: #FCE4EC;
    --bg-gradient-end: #E0F7FA;

    /* Glassmorphism */
    --surface-color: rgba(255, 255, 255, 0.75);
    --surface-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(20px);
    --shadow-lg: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    /* Text */
    --text-main: #2D2D2D;
    --text-secondary: #5F6368;

    /* Spacing & Radius */
    --radius-lg: 24px;
    --radius-md: 12px;
    --spacing-md: 1.5rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    /* Use dynamic viewport height for mobile browsers */
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Remove overflow:hidden from body to allow scrolling on small screens */
    overflow-x: hidden;
    position: relative;
}

/* Fixed Background Container */
#app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    /* Clip the blurry shapes */
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
}

/* Abstract Background Shapes */
#app-background::before,
#app-background::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
}

#app-background::before {
    background: #FFAB91;
    top: -50px;
    left: -50px;
    animation: float 6s ease-in-out infinite;
}

#app-background::after {
    background: #80DEEA;
    bottom: -50px;
    right: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 20px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* Main Container */
#app-container {
    width: 90%;
    max-width: 400px;
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

input[type="tel"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    text-align: center;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
    letter-spacing: 2px;
}

input[type="tel"]:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 112, 67, 0.1);
}

/* Buttons */
button {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

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

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

/* Info Card */
.info-card {
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-row .value {
    font-weight: 600;
    color: var(--text-main);
}

/* Success View */
.success-icon {
    color: #4CAF50;
    margin-bottom: 1rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.actions button {
    margin-top: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 112, 67, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Test Hint */
.test-hint {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.test-hint p {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Responsive Design (RWD) --- */

/* Tablet & Mobile (max-width: 768px) */
@media (max-width: 768px) {
    #app-container {
        width: 95%;
        /* Wider on mobile */
        padding: 1.5rem;
        /* Reduce padding */
    }

    /* Adjust background shapes to be less intrusive on mobile */
    #app-background::before,
    #app-background::after {
        width: 200px;
        height: 200px;
        opacity: 0.5;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
        /* Smaller title */
    }

    #app-container {
        padding: 1.25rem;
    }

    input[type="tel"] {
        font-size: 1.1rem;
        padding: 0.875rem;
    }

    .info-card {
        padding: 0.875rem;
    }

    .info-row .label,
    .info-row .value {
        font-size: 0.85rem;
        /* Compact info text */
    }

    /* Stack buttons if needed, but flex gap handles it well usually. 
       Let's ensure they don't overflow. */
    .actions {
        flex-direction: column-reverse;
        /* Stack buttons, Back on bottom */
    }

    .actions button {
        width: 100%;
    }
}