/* ===================================
   Installation Guide Portal - Premium UI
   Sleek, Modern Design with Gradients
   =================================== */

/* CSS Variables for theming */
:root {
    /* Black/Cyan Theme - MidnightOEM Inspired */
    --gradient-start: #00E5FF;
    --gradient-end: #0099CC;
    --gradient-purple: #00E5FF;
    --gradient-pink: #00E5FF;

    /* Dark theme colors - Professional Greys */
    --bg-dark: #141414;
    --surface-dark: #1E1E1E;
    --surface-light: #2E2E2E;
    --surface-lighter: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-tertiary: #6b7280;

    /* Accent colors */
    --success: #00E5FF;
    --error: #00E5FF;
    --warning: #00E5FF;

    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.6);
    --shadow-gradient: 0 12px 16px 0 rgba(0, 229, 255, 0.3);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Light theme */
@media (prefers-color-scheme: light) {
    :root {
        --bg-dark: #f5f5f5;
        --surface-dark: #ffffff;
        --surface-light: #f9fafb;
        --surface-lighter: #e5e7eb;
        --text-primary: #111827;
        --text-secondary: #4b5563;
        --text-tertiary: #9ca3af;
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #141414;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Portal Container */
.portal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    min-height: 100vh;
}

/* Portal Header */
.portal-header {
    text-align: center;
    padding: var(--spacing-2xl) 0;
    margin-bottom: var(--spacing-xl);
}

.portal-logo {
    max-width: 500px;
    height: auto;
    margin-bottom: var(--spacing-lg);
}

.portal-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #00E5FF;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.5px;
}

/* Card component - iOS Style */
.card {
    background: var(--surface-dark);
    border: 0.5px solid rgba(0, 229, 255, 0.15);
    border-radius: 16px;
    padding: var(--spacing-xl);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--spacing-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* PIN Entry Card */
.pin-entry-card {
    max-width: 500px;
    margin: 0 auto var(--spacing-2xl);
    position: relative;
}

.pin-entry-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xl);
    text-align: center;
    color: var(--text-primary);
}

/* Premium Forms */
.pin-form,
.admin-form {
    width: 100%;
}

.form-group {
    margin-bottom: var(--spacing-xl);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Premium Input Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    border: 2px solid var(--surface-lighter);
    border-radius: var(--radius-md);
    background: var(--surface-light);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #00E5FF;
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1), 0 0 20px rgba(0, 229, 255, 0.2);
    background: var(--surface-dark);
}

.pin-input {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 1rem;
    font-weight: 700;
    padding: var(--spacing-lg);
    background: var(--surface-light);
    border: 2px solid var(--surface-lighter);
    transition: all 0.3s ease;
}

.pin-input:focus {
    letter-spacing: 1.2rem;
    background: var(--surface-dark);
    border-color: #00E5FF;
    box-shadow: 0 0 0 2px #00E5FF, 0 0 30px rgba(0, 229, 255, 0.3);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

::placeholder {
    color: var(--text-tertiary);
}

/* Checkboxes - Custom styled */
.checkbox-group {
    display: flex;
    align-items: center;
    margin: var(--spacing-lg) 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
    text-transform: none;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.checkbox-group label:hover {
    color: var(--text-primary);
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: var(--spacing-md);
    cursor: pointer;
    accent-color: #00E5FF;
}

/* Clean Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface-light);
    color: var(--text-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gradient);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #00E5FF 0%, #0099CC 100%);
    color: #000000;
    box-shadow: var(--shadow-gradient);
    border: none;
    font-weight: 800;
}

.btn-primary:hover {
    box-shadow: 0 16px 32px rgba(0, 229, 255, 0.4);
    transform: translateY(-3px);
}

.btn-danger {
    background: linear-gradient(135deg, #00E5FF 0%, #0099CC 100%);
    color: #000000;
    box-shadow: 0 8px 16px rgba(0, 229, 255, 0.3);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.85rem;
}

.btn-logout {
    display: inline-block;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.btn-logout:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Single Guide Modal - iOS Style */
.single-guide-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-lg);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.single-guide-card {
    background: #1E1E1E;
    border-radius: 20px;
    padding: var(--spacing-2xl);
    max-width: 500px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.single-guide-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    color: #00E5FF;
}

.single-guide-icon svg {
    width: 100%;
    height: 100%;
}

.single-guide-greeting {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--spacing-md);
}

.single-guide-question {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-2xl);
    line-height: 1.6;
}

.single-guide-question strong {
    color: #00E5FF;
    font-weight: 600;
}

.single-guide-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.single-guide-open {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 480px) {
    .single-guide-card {
        padding: var(--spacing-xl);
    }

    .single-guide-greeting {
        font-size: 1.5rem;
    }

    .single-guide-question {
        font-size: 1rem;
    }
}

/* Category Section */
.category-section {
    margin-bottom: var(--spacing-2xl);
}

.category-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    color: #00E5FF;
    position: relative;
    padding-bottom: var(--spacing-sm);
    letter-spacing: -0.3px;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: #00E5FF;
    border-radius: 2px;
}

/* Guides Grid */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--spacing-lg);
}

/* Guide Card - iOS Style */
.guide-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-xl);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    background: rgba(0, 229, 255, 0.03);
    border: 0.5px solid rgba(0, 229, 255, 0.12);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.guide-icon {
    width: 72px;
    height: 72px;
    margin-bottom: var(--spacing-md);
    transition: all 0.3s ease;
}

.guide-icon svg {
    width: 100%;
    height: 100%;
}

.guide-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    transition: all 0.3s ease;
}

.guide-card-unlocked {
    border: 0.5px solid rgba(0, 229, 255, 0.25);
    background: rgba(0, 229, 255, 0.05);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.guide-card-unlocked:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 229, 255, 0.4);
    background: rgba(0, 229, 255, 0.08);
}

.guide-card-unlocked .guide-icon {
    color: #00E5FF;
}

.guide-card-unlocked:hover .guide-icon {
    transform: scale(1.05);
}

.guide-card-unlocked:hover h3 {
    color: #00E5FF;
}

.guide-card-locked {
    opacity: 0.4;
    border: 0.5px solid rgba(0, 229, 255, 0.08);
    cursor: not-allowed;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
}

.guide-card-locked::after {
    content: '';
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2300E5FF'%3E%3Cpath fill-rule='evenodd' d='M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    opacity: 0.5;
}

.guide-card-locked .guide-icon {
    color: rgba(0, 229, 255, 0.3);
}

.locked-message {
    font-size: 0.85rem;
    color: rgba(0, 229, 255, 0.5);
    margin-top: var(--spacing-sm);
    font-style: italic;
    font-weight: 500;
}

/* Error Card - iOS Style */
.error-card {
    max-width: 500px;
    margin: var(--spacing-2xl) auto;
    text-align: center;
    padding: var(--spacing-2xl);
    background: rgba(0, 229, 255, 0.05);
    border: 0.5px solid rgba(0, 229, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.icon-error {
    width: 80px;
    height: 80px;
    color: #00E5FF;
    margin: 0 auto var(--spacing-lg);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message {
    font-size: 1.1rem;
    color: #00E5FF;
    margin: var(--spacing-lg) 0;
    font-weight: 600;
}

.attempts-remaining,
.lockout-info {
    color: rgba(0, 229, 255, 0.7);
    font-size: 0.9rem;
    margin-top: var(--spacing-md);
}

/* Alerts */
.alert {
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
}

.alert-error {
    background: rgba(0, 229, 255, 0.1);
    border-color: #00E5FF;
    color: #00E5FF;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #6ee7b7;
}

.alert-info {
    background: rgba(0, 229, 255, 0.1);
    border-color: #00E5FF;
    color: #00E5FF;
}


/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #00E5FF;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .portal-container {
        padding: var(--spacing-md);
    }

    .portal-header h1 {
        font-size: 2rem;
    }

    .guides-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .category-title {
        font-size: 1.5rem;
    }

    .pin-input {
        font-size: 1.5rem;
        letter-spacing: 0.8rem;
    }

    .pin-input:focus {
        letter-spacing: 0.9rem;
    }
}

@media (max-width: 480px) {
    .portal-header h1 {
        font-size: 1.75rem;
    }

    .pin-input {
        font-size: 1.25rem;
        letter-spacing: 0.5rem;
    }

    .card {
        padding: var(--spacing-lg);
    }
}

/* Print styles */
@media print {
    .portal-header,
    .btn-logout {
        display: none;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Physical Card Design - iOS Style */
.physical-card-container {
    max-width: 420px;
    margin: 0 auto;
    padding: var(--spacing-2xl) 0;
    perspective: 1000px;
}

.physical-card {
    background: #1E1E1E;
    border-radius: 24px;
    padding: 3rem 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 2.5 / 3.5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: cardFloat 4s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.physical-card:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(0, 229, 255, 0.2);
}

/* Code Entry Field - Positioned above OEM */
.card-code-section {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.card-code-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.card-code-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 0.4rem;
    font-weight: 600;
    color: #00E5FF;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    width: 100%;
}

.card-code-input:focus {
    outline: none;
    border-color: #00E5FF;
    background: rgba(0, 229, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.1),
                inset 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5rem;
}

.card-code-input::placeholder {
    color: rgba(0, 229, 255, 0.25);
}

/* OEM Logo Section */
.card-oem-section {
    text-align: center;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.card-oem-logo-img {
    max-width: 200px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

/* Cyan Divider Line */
.card-divider {
    width: 100%;
    height: 3px;
    background: #00E5FF;
    margin: 1.5rem 0;
    border-radius: 2px;
}

/* Card Message */
.card-message {
    text-align: center;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.6;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 1.5rem 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Submit Button for Card - iOS Style */
.card-submit-btn {
    margin-top: 1.5rem;
    width: 100%;
    background: linear-gradient(135deg, #00E5FF 0%, #0099CC 100%);
    color: #000000;
    font-weight: 600;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.card-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-submit-btn:active {
    transform: scale(0.98);
}

/* Responsive for physical card */
@media (max-width: 480px) {
    .physical-card-container {
        max-width: 360px;
    }

    .physical-card {
        padding: 2.5rem 1.5rem;
    }

    .card-oem-logo {
        font-size: 3.5rem;
        letter-spacing: 6px;
    }

    .card-code-input {
        font-size: 1.1rem;
        letter-spacing: 0.3rem;
        padding: 0.65rem 0.85rem;
    }

    .card-code-input:focus {
        letter-spacing: 0.35rem;
    }

    .card-message {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .card-submit-btn {
        font-size: 0.9rem;
        padding: 0.9rem;
    }
}

/* Neo Toggle Switch - Blue Theme */
.neo-toggle-container {
  --toggle-width: 80px;
  --toggle-height: 38px;
  --toggle-bg: #181c20;
  --toggle-off-color: #475057;
  --toggle-on-color: #00E5FF;
  --toggle-transition: 0.4s cubic-bezier(0.25, 1, 0.5, 1);

  position: relative;
  display: inline-flex;
  flex-direction: column;
  font-family: "Segoe UI", Tahoma, sans-serif;
  user-select: none;
}

.neo-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.neo-toggle {
  position: relative;
  width: var(--toggle-width);
  height: var(--toggle-height);
  display: block;
  cursor: pointer;
  transform: translateZ(0);
  perspective: 500px;
}

.neo-track {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--toggle-height) / 2);
  overflow: hidden;
  transform-style: preserve-3d;
  transform: translateZ(-1px);
  transition: transform var(--toggle-transition);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.neo-background-layer {
  position: absolute;
  inset: 0;
  background: var(--toggle-bg);
  background-image: linear-gradient(
    -45deg,
    rgba(20, 20, 20, 0.8) 0%,
    rgba(30, 30, 30, 0.3) 50%,
    rgba(20, 20, 20, 0.8) 100%
  );
  opacity: 1;
  transition: all var(--toggle-transition);
}

.neo-grid-layer {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      to right,
      rgba(71, 80, 87, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(71, 80, 87, 0.05) 1px, transparent 1px);
  background-size: 5px 5px;
  opacity: 0;
  transition: opacity var(--toggle-transition);
}

.neo-track-highlight {
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--toggle-height) / 2);
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0));
  opacity: 0;
  transition: all var(--toggle-transition);
}

.neo-spectrum-analyzer {
  position: absolute;
  bottom: 6px;
  right: 10px;
  height: 10px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--toggle-transition);
}

.neo-spectrum-bar {
  width: 2px;
  height: 3px;
  background-color: var(--toggle-on-color);
  opacity: 0.8;
}

.neo-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transform-style: preserve-3d;
  transition: transform var(--toggle-transition);
  z-index: 1;
}

.neo-thumb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--toggle-off-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all var(--toggle-transition);
}

.neo-thumb-core {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  transition: all var(--toggle-transition);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.neo-thumb-icon {
  position: relative;
  width: 10px;
  height: 10px;
  transition: all var(--toggle-transition);
}

.neo-thumb-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background: var(--toggle-off-color);
  transform: translate(-50%, -50%);
  transition: all var(--toggle-transition);
}

.neo-thumb-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--toggle-off-color);
  transform: scale(0);
  opacity: 0;
  transition: all var(--toggle-transition);
}

.neo-gesture-area {
  position: absolute;
  inset: -10px;
  z-index: 0;
}

.neo-interaction-feedback {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.neo-ripple {
  position: absolute;
  top: 50%;
  left: 30%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--toggle-on-color) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all 0.4s ease-out;
}

.neo-progress-arc {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--toggle-on-color);
  transform: translate(-50%, -50%) scale(0) rotate(0deg);
  opacity: 0;
  transition:
    opacity 0.3s ease,
    transform 0.5s ease;
}

.neo-toggle-input:checked + .neo-toggle .neo-thumb {
  transform: translateX(calc(var(--toggle-width) - 38px));
}

.neo-toggle-input:checked + .neo-toggle .neo-thumb-ring {
  background-color: var(--toggle-on-color);
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

.neo-toggle-input:checked + .neo-toggle .neo-thumb-wave {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #fff;
}

.neo-toggle-input:checked + .neo-toggle .neo-thumb-pulse {
  transform: scale(1.2);
  opacity: 0.3;
  animation: neo-pulse 1.5s infinite;
}

.neo-toggle-input:checked + .neo-toggle .neo-track-highlight {
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2));
  opacity: 1;
}

.neo-toggle-input:checked + .neo-toggle .neo-grid-layer {
  opacity: 1;
}

.neo-toggle-input:checked + .neo-toggle .neo-spectrum-analyzer {
  opacity: 1;
}

.neo-toggle-input:checked + .neo-toggle .neo-spectrum-bar:nth-child(1) {
  animation: neo-spectrum 0.9s infinite;
}

.neo-toggle-input:checked + .neo-toggle .neo-spectrum-bar:nth-child(2) {
  animation: neo-spectrum 0.8s 0.1s infinite;
}

.neo-toggle-input:checked + .neo-toggle .neo-spectrum-bar:nth-child(3) {
  animation: neo-spectrum 1.1s 0.2s infinite;
}

.neo-toggle-input:checked + .neo-toggle .neo-spectrum-bar:nth-child(4) {
  animation: neo-spectrum 0.7s 0.1s infinite;
}

.neo-toggle-input:checked + .neo-toggle .neo-spectrum-bar:nth-child(5) {
  animation: neo-spectrum 0.9s 0.15s infinite;
}

.neo-toggle:hover .neo-thumb-ring {
  transform: scale(1.05);
}

@keyframes neo-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.2;
  }
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
}

@keyframes neo-spectrum {
  0% {
    height: 3px;
  }
  50% {
    height: 8px;
  }
  100% {
    height: 3px;
  }
}

/* Selection color */
::selection {
    background: rgba(0, 229, 255, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(0, 229, 255, 0.3);
    color: white;
}

/* iOS-Specific Optimizations */
@supports (-webkit-touch-callout: none) {
    /* iOS Safe Area Support */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Smooth scrolling on iOS */
    .portal-container {
        -webkit-overflow-scrolling: touch;
    }

    /* Remove tap highlight */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea {
        font-size: 16px;
    }
}

/* Touch-friendly buttons */
.btn,
.card-submit-btn,
.btn-logout,
.guide-card {
    -webkit-tap-highlight-color: rgba(0, 229, 255, 0.1);
    -webkit-user-select: none;
    user-select: none;
}

/* iOS-style active states */
.btn:active,
.card-submit-btn:active {
    opacity: 0.8;
}

.guide-card-unlocked:active {
    transform: scale(0.98);
}

/* Optimize for iPhone sizes */
@media (max-width: 428px) {
    .portal-container {
        padding: var(--spacing-md);
    }

    .portal-logo {
        max-width: 340px;
    }

    .physical-card-container {
        max-width: 100%;
        padding: var(--spacing-md);
    }

    .physical-card {
        border-radius: 20px;
        padding: 2rem 1.5rem;
    }

    .card-oem-logo {
        font-size: 3.5rem;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .guides-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* Prevent text size adjustment on iOS */
html {
    -webkit-text-size-adjust: 100%;
}

/* Error Page Button - No Glow */
.error-card .btn-primary {
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.15);
    background: rgba(0, 229, 255, 0.15);
    color: #00E5FF;
    border: 1px solid rgba(0, 229, 255, 0.3);
    font-weight: 600;
}

.error-card .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
    transform: translateY(-1px);
    background: rgba(0, 229, 255, 0.2);
}

/* Request Access Button */
.btn-request-access {
    border: none;
    display: flex;
    padding: 0.875rem 1.75rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    line-height: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    vertical-align: middle;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    user-select: none;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.btn-request-access:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 229, 255, 0.3);
    color: #00E5FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-request-access:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-request-access svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ===================================
   Live Support Message Box
   =================================== */
.guides-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.guides-header .portal-logo {
    max-width: 150px;
    height: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.messageBox {
    width: fit-content;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2d2d2d;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid rgb(63, 63, 63);
    transition: all 0.3s;
}

.messageBox:focus-within {
    border: 1px solid rgb(110, 110, 110);
}

#messageInput {
    width: 200px;
    height: 100%;
    background-color: transparent;
    outline: none;
    border: none;
    padding-left: 10px;
    color: white;
    font-size: 0.875rem;
}

#messageInput::placeholder {
    color: #888;
}

#messageInput:focus ~ #sendButton svg path,
#messageInput:valid ~ #sendButton svg path {
    fill: #3c3c3c;
    stroke: white;
}

#sendButton {
    width: fit-content;
    height: 100%;
    background-color: transparent;
    outline: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    margin-left: 8px;
}

#sendButton svg {
    height: 18px;
    transition: all 0.3s;
}

#sendButton svg path {
    transition: all 0.3s;
}

#sendButton:hover svg path {
    fill: #3c3c3c;
    stroke: white;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .guides-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .messageBox {
        flex: 1;
        max-width: 250px;
    }

    #messageInput {
        width: 150px;
    }
}
