/* Color Palette - Gas And Go Warm Dark Theme */
:root {
    --primary-red: #ED1C24;
    --primary-yellow: #FDB913;
    --primary-black: #000000;
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --bg-input: #2a2a2a;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-dark: #121212;
    --border: #333333;
    --accent-orange: #ff8c00;
    --success: #66bb6a;
    --error: #ef5350;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-strong: rgba(0, 0, 0, 0.6);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    line-height: 1.6;
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    padding: 20px;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 15px 50px var(--shadow-strong);
    border: 1px solid var(--border);
    max-height: 95vh;
    overflow-y: auto;
}

/* Welcome/Auth Screens */
.brand-logo {
    width: 280px;
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto 30px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

.brand-logo-small {
    width: 180px;
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

.coffee-icon {
    font-size: 80px;
    text-align: center;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(253, 185, 19, 0.3));
}

.coffee-icon-small {
    font-size: 50px;
    text-align: center;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

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

h1 {
    text-align: center;
    color: var(--primary-yellow);
    font-size: 2.2rem;
    margin-bottom: 12px;
    font-weight: 800;
}

.tagline {
    text-align: center;
    color: var(--text-main);
    margin-bottom: 40px;
    font-size: 1.1rem;
    opacity: 0.8;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.back-btn-container {
    margin-bottom: 20px;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-medium);
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.form-message {
    min-height: 20px;
    text-align: center;
    font-size: 0.95rem;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-message.success {
    background: rgba(102, 187, 106, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.form-message.error {
    background: rgba(239, 83, 80, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

/* Form Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
    padding: 15px 20px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus {
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 3px rgba(253, 185, 19, 0.1);
    background: #2a2a2a;
}

/* Input Error State */
input.error {
    border-color: var(--error);
    background-color: rgba(239, 83, 80, 0.05);
}

input.error:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.1);
}

/* Field Error Messages */
.field-error {
    display: none;
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 5px;
    font-weight: 500;
}

/* Password Requirements */
.password-requirements {
    margin-top: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--text-muted);
}

.password-requirements small {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-medium);
    font-size: 0.813rem;
}

.password-requirements span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.req-unchecked {
    color: var(--text-light);
}

.req-checked {
    color: var(--success);
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red) 0%, #b31217 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(237, 28, 36, 0.2);
}

.btn-primary:hover {
    background: #c91820;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(237, 28, 36, 0.3);
}

.btn-secondary {
    background: var(--primary-yellow);
    color: var(--primary-black);
}

.btn-secondary:hover:not(:disabled) {
    background: #e5a711;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(253, 185, 19, 0.2);
}

.btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Dashboard Header */
.header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info h2 {
    color: var(--primary-yellow);
    font-size: 1.6rem;
    font-weight: 800;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-profile {
    background: rgba(253, 185, 19, 0.1);
    border: 1px solid var(--primary-yellow);
    color: var(--primary-yellow);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-profile:hover {
    background: var(--primary-yellow);
    color: var(--primary-black);
    transform: translateY(-2px);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(239, 83, 80, 0.1);
    color: var(--error);
    border-color: var(--error);
}

/* Token Card */
.token-card {
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    color: var(--text-main);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.token-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(237, 28, 36, 0.1) 0%, transparent 70%);
}

.token-icon {
    font-size: 55px;
    filter: drop-shadow(0 0 10px rgba(237, 28, 36, 0.3));
}

.token-info h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.token-count {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-yellow);
    text-shadow: 0 0 15px rgba(253, 185, 19, 0.2);
    margin-bottom: 5px;
}

.token-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Last Purchase Info */
.last-purchase {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    border: 1px solid var(--border);
}

.last-purchase.hidden {
    display: none;
}

.last-purchase strong {
    color: var(--text-main);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 35px;
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.reward-label {
    font-weight: 700;
    color: var(--primary-yellow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-bar {
    height: 14px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-yellow) 0%, #ff8c00 100%);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(253, 185, 19, 0.3);
    width: 0%;
}

/* Action Buttons */
.actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-action i {
    color: var(--primary-yellow);
    font-size: 1rem;
}

.btn-action:hover:not(:disabled) {
    background: var(--bg-input);
    border-color: var(--text-muted);
    color: var(--text-main);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Message Box */
.message-box {
    min-height: 20px;
    text-align: center;
    font-size: 0.95rem;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-bottom: 20px;
}

.message-box.success {
    background: rgba(102, 187, 106, 0.1);
    color: var(--success);
    border: 1px solid rgba(102, 187, 106, 0.2);
}

.message-box.error {
    background: rgba(239, 83, 80, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 83, 80, 0.2);
}

/* Modal/Redeem Styling */
.redeem-header {
    text-align: center;
    margin-bottom: 30px;
}

.redeem-header i {
    font-size: 50px;
    color: var(--primary-yellow);
    margin-bottom: 15px;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    background: white;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    padding: 10px;
}

.redeem-instructions {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.redeem-instructions strong {
    color: var(--primary-yellow);
}
.profile-header {
    text-align: center;
    margin-bottom: 35px;
}

.profile-icon {
    font-size: 70px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(253, 185, 19, 0.2));
}

.profile-info {
    background: rgba(255, 255, 255, 0.03);
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 35px;
    border: 1px solid var(--border);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

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

#profileScreen.history-only .profile-only {
    display: none;
}

#profileScreen.history-only .history-section {
    margin-top: 0;
}

.history-section {
    margin-top: 40px;
}

.history-section h3 {
    color: var(--primary-yellow);
    margin-bottom: 25px;
    font-size: 1.4rem;
    font-weight: 800;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-token {
    font-weight: 800;
    color: var(--primary-yellow);
    font-size: 1.2rem;
}

.history-pin {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: monospace;
}

.history-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.no-history {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-medium);
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    color: var(--primary-yellow);
    font-size: 1.4rem;
    font-weight: 800;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 30px;
}

.modal-body p {
    margin-bottom: 20px;
    color: var(--text-muted);
    text-align: center;
    font-size: 1rem;
}

.modal-body input {
    width: 100%;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
    letter-spacing: 12px;
    font-weight: 700;
}

/* Gas Code Modal Specific */
.gas-code-body {
    text-align: center;
}

.gas-code-display {
    background: var(--bg-input);
    padding: 30px;
    border-radius: 16px;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-yellow);
    letter-spacing: 6px;
    margin: 25px 0;
    border: 1px solid var(--border);
    text-shadow: 0 0 15px rgba(253, 185, 19, 0.2);
}
    border: 3px dashed #ddd;
}

.gas-code-note {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-bottom: 25px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .token-card {
        padding: 20px;
    }
    
    .token-count {
        font-size: 2.5rem;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-info h2 {
        font-size: 1.5rem;
    }
    
/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .container {
        padding: 25px 20px;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }

    .brand-logo {
        width: 220px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .token-card {
        padding: 20px;
        gap: 15px;
    }

    .token-count {
        font-size: 2.5rem;
    }

    .btn-action {
        padding: 15px 10px;
    }
}