/* ============================================================================
   Mắt Kính Tâm Đức - Landing Page Đặt Lịch Hẹn
   Mobile-first responsive design
   ============================================================================ */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    --primary: #1a7f64;
    --primary-dark: #156b54;
    --primary-light: #e8f5f1;
    --secondary: #f8b500;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --success: #10b981;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 12px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.header-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

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

.header-phone svg {
    width: 18px;
    height: 18px;
}

@media (min-width: 768px) {
    .logo img {
        height: 48px;
    }

    .header-phone {
        padding: 10px 20px;
        font-size: 15px;
    }
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
    padding: 80px 0 40px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
    min-height: auto;
    display: flex;
    align-items: center;
}

.hero .container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-content {
    text-align: center;
}

.hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 12px;
}

.hero h1 span {
    color: var(--primary);
    display: block;
}

.hero-tagline {
    font-size: 16px;
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .hero {
        padding: 120px 0 80px;
    }

    .hero .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .hero-content {
        flex: 1;
        text-align: left;
        padding-right: 40px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero h1 span {
        display: inline;
    }

    .hero-tagline {
        font-size: 17px;
        margin: 0;
    }
}

@media (min-width: 1024px) {
    .hero h1 {
        font-size: 52px;
    }
}

/* --------------------------------------------------------------------------
   Form Card
   -------------------------------------------------------------------------- */
.form-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 28px 24px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.form-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group .required {
    color: var(--error);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 127, 100, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input.error {
    border-color: var(--error);
}

.error-message {
    display: block;
    font-size: 13px;
    color: var(--error);
    margin-top: 6px;
    min-height: 20px;
}

.btn-submit {
    width: 100%;
    padding: 16px 24px;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

.form-message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

@media (min-width: 768px) {
    .form-card {
        padding: 36px 32px;
        margin: 0;
    }

    .form-card h2 {
        font-size: 26px;
    }
}

/* --------------------------------------------------------------------------
   Section Titles
   -------------------------------------------------------------------------- */
.section-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 32px;
    }

    .section-subtitle {
        font-size: 16px;
        margin-bottom: 48px;
    }
}

/* --------------------------------------------------------------------------
   Process Section
   -------------------------------------------------------------------------- */
.process {
    padding: 40px 0;
    background: var(--gray-50);
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.process-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    transition: var(--transition);
}

.process-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.process-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.process-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary);
}

.process-item h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.process-item p {
    font-size: 13px;
    color: var(--text-light);
}

@media (min-width: 768px) {
    .process {
        padding: 80px 0;
    }

    .process-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .process-item {
        padding: 28px 24px;
    }

    .process-icon {
        width: 72px;
        height: 72px;
    }

    .process-icon svg {
        width: 36px;
        height: 36px;
    }

    .process-item h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .process-item p {
        font-size: 14px;
    }
}

@media (min-width: 1024px) {
    .process-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Partners Section
   -------------------------------------------------------------------------- */
.partners {
    padding: 40px 0;
    background: var(--white);
}

.partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.partner-item {
    width: calc(33.333% - 14px);
    max-width: 140px;
    padding: 16px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.partner-item:hover {
    background: var(--primary-light);
}

.partner-item img {
    max-height: 55px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

@media (min-width: 768px) {
    .partners {
        padding: 60px 0;
    }

    .partners-grid {
        gap: 32px;
    }

    .partner-item {
        width: auto;
        max-width: 180px;
        padding: 24px 32px;
    }

    .partner-item img {
        max-height: 65px;
    }
}

/* --------------------------------------------------------------------------
   Branches Section
   -------------------------------------------------------------------------- */
.branches {
    padding: 40px 0;
    background: var(--gray-50);
}

.branches-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.branch-item {
    display: block;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

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

.branch-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.branch-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

.branch-item h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.branch-item p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

.branch-phone {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition);
}

.branch-phone:hover {
    color: var(--primary-dark);
}

@media (min-width: 768px) {
    .branches {
        padding: 80px 0;
    }

    .branches-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .branch-item {
        padding: 24px;
    }

    .branch-icon {
        width: 48px;
        height: 48px;
    }

    .branch-icon svg {
        width: 24px;
        height: 24px;
    }

    .branch-item h3 {
        font-size: 17px;
        margin-bottom: 8px;
    }

    .branch-item p {
        font-size: 14px;
    }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    background: var(--text);
    color: var(--white);
    padding: 48px 0 24px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-brand {
    text-align: center;
}

.footer-logo {
    height: 40px;
    margin: 0 auto 12px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--gray-300);
}

.footer-contact,
.footer-social {
    text-align: center;
}

.footer-contact h4,
.footer-social h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-contact p {
    font-size: 14px;
    color: var(--gray-300);
    margin-bottom: 8px;
}

.footer-contact a:hover {
    color: var(--secondary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 13px;
    color: var(--gray-300);
}

@media (min-width: 768px) {
    .footer {
        padding: 64px 0 32px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .footer-brand,
    .footer-contact,
    .footer-social {
        text-align: left;
    }

    .footer-brand {
        flex: 1;
    }

    .footer-logo {
        margin: 0 0 12px 0;
    }

    .social-links {
        justify-content: flex-start;
    }
}

/* --------------------------------------------------------------------------
   Floating CTA (Mobile only)
   -------------------------------------------------------------------------- */
.floating-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
}

.floating-cta:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.floating-cta svg {
    width: 20px;
    height: 20px;
}

@media (min-width: 768px) {
    .floating-cta {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --------------------------------------------------------------------------
   Mobile Optimizations
   -------------------------------------------------------------------------- */
/* Safe area for iPhone notch */
@supports (padding: env(safe-area-inset-bottom)) {
    .header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }

    .floating-cta {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* Touch feedback */
@media (hover: none) and (pointer: coarse) {
    .btn-submit:active,
    .header-phone:active,
    .floating-cta:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    .branch-item:active,
    .process-item:active,
    .partner-item:active {
        transform: scale(0.98);
    }
}

/* Prevent text selection on interactive elements */
.btn-submit,
.header-phone,
.floating-cta,
.branch-item,
.process-item {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

/* Smooth scrolling for anchor links */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Improve font rendering on mobile */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
