/**
 * Medical Store Loyalty System - Customer Stylesheet
 * 
 * Mobile-first responsive design for customer-facing pages
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --primary-color: #00897b;
    --primary-dark: #00695c;
    --primary-light: #4db6ac;
    --secondary-color: #26a69a;
    --secondary-dark: #00897b;
    --accent-color: #b2dfdb;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;

    --text-dark: #1f2937;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --text-muted: #9ca3af;

    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-medium: #f3f4f6;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #00897b 0%, #004d40 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    text-align: center;
    padding: 20px 0;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.logo i {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.tagline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.tagline i {
    color: var(--accent-color);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideDown 0.4s ease;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert i {
    font-size: 1.2rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: pulse 2s infinite;
}

.hero-icon i {
    font-size: 2.5rem;
    color: white;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(37, 99, 235, 0);
    }
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.hero p {
    color: var(--text-medium);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-medium);
    transition: var(--transition-fast);
}

.benefit-item:hover {
    background: #e0e7ff;
    transform: translateX(5px);
}

.benefit-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* ============================================
   FORM SECTION
   ============================================ */
.form-section {
    margin-bottom: 24px;
}

.form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.form-header {
    text-align: center;
    margin-bottom: 24px;
}

.form-header i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.form-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.form-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 0.95rem;
}

.required {
    color: var(--danger-color);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 14px;
    font-weight: 600;
    color: var(--text-medium);
    font-size: 0.95rem;
}

.input-icon {
    position: absolute;
    right: 14px;
    font-size: 1.1rem;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    padding-left: 50px;
    padding-right: 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--bg-white);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper input.has-prefix {
    padding-left: 50px;
}

.input-wrapper input.is-valid {
    border-color: var(--success-color);
    padding-right: 40px;
}

.input-wrapper input.is-invalid {
    border-color: var(--danger-color);
    padding-right: 40px;
}

.input-wrapper input.is-valid+.input-icon::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--success-color);
}

.input-wrapper input.is-invalid+.input-icon::before {
    content: '\f00d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--danger-color);
}

.error-message {
    display: block;
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 6px;
    min-height: 18px;
}

.help-text {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 6px;
}

/* Reward Preview */
.reward-preview {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px dashed var(--success-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.preview-title i {
    color: var(--success-color);
}

.preview-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.preview-label {
    color: var(--text-medium);
}

.preview-value {
    font-weight: 600;
    color: #065f46;
}

/* File Upload */
.file-upload-wrapper {
    width: 100%;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--bg-light);
    position: relative;
    overflow: hidden;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: scale(1.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-placeholder i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.upload-placeholder span {
    font-weight: 500;
    color: var(--text-dark);
}

.upload-placeholder small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.upload-preview {
    position: relative;
    display: inline-block;
}

.upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Terms Checkbox */
.terms-group {
    margin-top: 24px;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    cursor: pointer;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    margin-top: 2px;
}

.checkbox-label input:checked+.checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input:checked+.checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 0.75rem;
}

.terms-text {
    font-size: 0.85rem !important;
    color: var(--text-medium) !important;
    font-weight: 400 !important;
    line-height: 1.5;
}

.terms-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    box-shadow: var(--shadow-md);
}

.submit-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn .btn-text,
.submit-btn .btn-loader {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.how-it-works {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.how-it-works h2 {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step {
    text-align: center;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    position: relative;
}

.step-number {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.step-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 16px;
    box-shadow: var(--shadow-sm);
}

.step-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.step h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.step p {
    font-size: 0.85rem;
    color: var(--text-medium);
}

.step-arrow {
    text-align: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    transform: rotate(90deg);
}

/* ============================================
   FAQ SECTION
   ============================================ */
.faq-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.faq-section h2 {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-light);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.faq-question:hover {
    background: #e0e7ff;
}

.faq-question i {
    color: var(--primary-color);
    transition: var(--transition-fast);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 16px;
    font-size: 0.85rem;
    color: var(--text-medium);
    line-height: 1.6;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 24px 0;
    color: white;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.store-info,
.store-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.store-info i,
.store-contact i {
    color: var(--accent-color);
}

.copyright {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.copyright p {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 20px 0 10px;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

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

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (min-width: 640px) {
    .container {
        max-width: 600px;
        padding: 30px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .benefits {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .benefit-item {
        flex: 1;
        min-width: 140px;
    }

    .steps {
        flex-direction: row;
        align-items: center;
    }

    .step {
        flex: 1;
    }

    .step-arrow {
        transform: rotate(0);
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    .hero {
        padding: 40px;
    }

    .form-card {
        padding: 40px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner */
.fa-spin {
    animation: fa-spin 1s linear infinite;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Success Animation */
.success-animation {
    animation: successPop 0.5s ease;
}

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

    50% {
        transform: scale(1.1);
    }

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