/* Basic Reset & Defaults */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #f4f7f6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* Main Container */
.container {
    background-color: #ffffff;
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

/* Logo */
.logo img {
    max-width: 150px;
    height: auto;
    margin-bottom: 30px;
}

/* Message Container & States General */
#message-container h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

#message-container p {
    margin-bottom: 20px;
    color: #555;
}

/* Spinner for Loading State */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: #007bff;
    animation: spin 1s linear infinite;
    margin: 20px auto 30px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States General Margin */
#success-state, #error-state {
    margin-top: 20px;
}

/* === Success State Styles === */
#success-state {
    display: none;
    padding-top: 20px;
}

.success-icon {
    margin-bottom: 25px;
}

.success-icon svg {
    width: 60px;
    height: 60px;
    display: block;
    margin: 0 auto;
    animation: scaleUp 0.5s ease-out forwards;
}

@keyframes scaleUp {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* === Enhanced Success Flow === */
.confirmation-flow {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-text {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.progress-indicator {
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: #4CAF50;
    animation: progress 2s ease-out forwards;
}

@keyframes progress {
    0% { width: 0; }
    80% { width: 100%; }
    100% { width: 100%; }
}

.fallback-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fallback-info {
    color: #666;
    font-size: 0.95rem;
}

/* === Enhanced App Buttons === */
.store-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.app-button {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 180px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.app-button .icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
}

.app-button .icon img.apple-svg-icon {
    display: block;      /* Prevents potential extra space below */
    height: 20px;        /* Set the desired height - ADJUST AS NEEDED */
    width: auto;         /* Maintain aspect ratio based on height */
    max-width: 100%;     /* Ensure it doesn't overflow the icon span */

    /* Coloring attempt (Editing SVG fill="currentColor" is more reliable) */
}

.app-button .label {
    text-align: left;
    line-height: 1.3;
    font-size: 0.8rem;
}

.app-button .store-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.ios-button {
    background: #000;
    color: #fff;
}

.android-button {
    background: #4285F4;
    color: #fff;
}

.ios-button:hover {
    background: #222;
    transform: translateY(-1px);
}

.android-button:hover {
    background: #3367D6;
    transform: translateY(-1px);
}

/* === Web Link === */
.web-alternative {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #666;
}

.web-link {
    color: #4285F4;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

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

/* === Error State Styles === */
#error-state h2 {
    font-size: 1.5em;
    color: #dc3545;
}

#error-message {
    color: #555;
    font-weight: 500;
}

#error-state p a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

#error-state p a:hover {
    text-decoration: underline;
}

.status-message {
    font-size: 0.9em;
    margin-top: 15px;
    font-weight: 500;
    min-height: 1.2em;
}

.status-message.success {
    color: #28a745;
}

.status-message.error {
    color: #dc3545;
}

/* === Responsive Adjustments === */
@media (max-width: 480px) {
    .container {
        padding: 30px 20px;
    }
    
    .store-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .app-button {
        width: 100%;
        max-width: 240px;
        justify-content: center;
    }
}