@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1e88e5;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --secondary: #26c6da;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --dark: #1a1a2e;
    --light: #f5f7fa;
    --gray: #757575;
    --gray-light: #e0e0e0;
    --border: #e8ecf1;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Cairo', 'Poppins', system-ui, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100vw;
}

main.site-main {
    flex: 1;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

body.ltr {
    direction: ltr;
    text-align: left;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ============ ANIMATIONS ============ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============ HEADER ============ */
.site-header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.brand a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-image {
    height: 40px;
    width: auto;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav a {
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    white-space: nowrap;
}

.nav a:hover {
    color: var(--primary-dark);
}

.nav-logout-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border: none;
    cursor: pointer;
    font-family: 'Cairo', 'Poppins', sans-serif;
    color: white;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nav-logout-btn svg {
    flex-shrink: 0;
}

.nav-logout-btn:hover {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(244, 67, 54, 0.3);
}

#install-app-btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: 'Cairo', 'Poppins', sans-serif;
}

#install-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ============ BUTTONS ============ */
.btn-primary,
.btn-secondary,
.btn-tertiary,
.btn-small,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    font-family: 'Cairo', 'Poppins', sans-serif;
    will-change: transform, box-shadow;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    transition: opacity 0.2s ease;
}

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-tertiary {
    background: var(--light);
    color: var(--primary);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.btn-tertiary:hover {
    background: white;
    border-color: var(--primary);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    background: var(--primary);
    color: white;
    transition: all 0.15s ease;
    will-change: background-color;
}

.btn-small:hover {
    opacity: 0.85;
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Cairo', 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.btn-primary:focus,
.btn-secondary:focus,
.btn-tertiary:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ============ ALERTS ============ */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-error {
    background: #ffebee;
    border-color: var(--danger);
    color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    border-color: var(--success);
    color: #2e7d32;
}

.alert-warning {
    background: #fff3e0;
    border-color: var(--warning);
    color: #e65100;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert li {
    margin: 4px 0;
}

/* ============ HERO SECTION ============ */
.hero {
    padding: 60px 0;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-text h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero-text p {
    font-size: 18px;
    color: var(--gray);
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.card-preview {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 40px;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-lg);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-preview::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.card-preview > * {
    position: relative;
    z-index: 1;
}

.card-preview:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.2);
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    background: var(--secondary);
    border-radius: 50%;
    margin: 0 auto 20px;
}

.card-preview h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.card-preview .btn-link {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 10px 20px;
    margin: 6px;
    border-radius: 6px;
    display: inline-block;
}

/* ============ DASHBOARD ============ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.panel:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.panel h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark);
    border-bottom: 2px solid var(--light);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============ AUTH SECTION ============ */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 40px 0;
}

.auth-inner {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

.auth-inner h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: var(--dark);
}

.auth-inner p {
    text-align: center;
    margin-top: 16px;
    color: var(--gray);
}

.auth-inner a {
    color: var(--primary);
    font-weight: 600;
}

/* ============ LINKS LIST ============ */
.links-list {
    list-style: none;
    margin: 20px 0;
}

.link-item {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    transition: all 0.3s ease;
    will-change: transform, background-color;
    border-left: 4px solid var(--primary);
}

.link-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    background: white;
}

.link-item:active {
    cursor: grabbing;
}

.link-item[style*="opacity: 0.4"] {
    opacity: 0.4;
    background: #e3f2fd;
}

.link-item-drag-handle {
    cursor: grab;
    color: var(--gray);
    font-weight: bold;
    margin-right: 8px;
}

.link-item-drag-handle:active {
    cursor: grabbing;
}

.link-content {
    flex: 1;
    min-width: 0;
}

.link-label {
    font-weight: 500;
    word-break: break-word;
    color: var(--dark);
}

.link-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 12px;
}

.link-main {
    flex: 1;
}

.link-main strong {
    display: block;
    margin-bottom: 4px;
    color: var(--dark);
}

.link-actions {
    display: flex;
    gap: 8px;
}

/* ============ MODAL ============ */
.modal {
    display: flex;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 24px;
    position: relative;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 100%;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--light);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.2s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 0;
}

.modal-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid var(--light);
    display: flex;
    gap: 12px;
    flex-direction: row-reverse;
}

.qr-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.qr-panel {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

.qr-panel h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.qr-panel .muted {
    font-size: 14px;
    margin-bottom: 30px;
    color: var(--gray);
}

.qr-container {
    margin: 35px 0;
}

.qr-image-wrapper {
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 380px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.qr-image-holder {
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-code-img {
    max-width: 350px;
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

.qr-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* ============ UTILITIES ============ */
.muted {
    color: var(--gray);
}

.small-text {
    font-size: 12px;
}

.switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.switch input {
    width: 48px;
    height: 24px;
    position: relative;
    appearance: none;
    background: var(--gray-light);
    outline: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.switch input:checked {
    background: var(--success);
}

/* ============ FOOTER ============ */
.site-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    opacity: 0.8;
}

/* ============ RESPONSIVE ============ */
/* ============ MOBILE RESPONSIVE (576px & down) ============ */
@media (max-width: 576px) {
    .container {
        padding: 0 12px;
    }

    /* Header Fix */
    .header-inner {
        padding: 10px 0;
        gap: 8px;
    }

    .logo-image {
        height: 30px;
    }

    .logo-text {
        font-size: 15px;
    }

    .nav {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav a,
    .nav-logout-btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .nav form {
        margin: 0;
        display: inline-flex;
    }

    #install-app-btn {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }

    /* Dashboard Grid (Icons) Fix */
    .db-icons {
        display: grid;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    .db-icon-item {
        padding: 10px 5px !important;
    }

    .db-icon-item img, .db-icon-item svg {
        width: 32px !important;
        height: 32px !important;
    }

    .db-icon-item span {
        font-size: 11px !important;
    }

    /* Links List Fix */
    .link-item {
        padding: 12px 10px !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .link-content {
        width: 100%;
    }

    .link-actions {
        width: 100%;
        justify-content: flex-end;
        border-top: 1px solid rgba(0,0,0,0.05);
        padding-top: 8px;
    }

    /* Table Fix */
    .table-wrap {
        margin: 0 -12px;
        padding: 0 12px;
        width: calc(100% + 24px);
    }

    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-tertiary,
    .btn-small,
    .btn-danger {
        width: 100%;
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 12px;
    }

    .btn-small {
        width: auto;
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Nav buttons stay compact — never stretch full width */
    .nav .btn-primary,
    .nav .btn-secondary {
        width: auto !important;
        padding: 7px 14px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    /* Forms — prevent iOS zoom */
    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px;
        font-size: 16px;
        border-radius: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .form-actions button,
    .form-actions a {
        width: 100%;
    }

    /* Hero Section */
    .hero {
        padding: 32px 0;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-text h1 {
        font-size: 28px;
        line-height: 1.3;
    }

    .hero-text p {
        font-size: 15px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 10px;
    }

    .hero-actions a {
        padding: 14px 16px !important;
        font-size: 14px !important;
        width: 100%;
        text-align: center;
    }

    .card-preview {
        padding: 24px 16px;
        min-height: auto;
        border-radius: 14px;
    }

    .card-preview h2 {
        font-size: 18px;
    }

    .avatar-placeholder {
        width: 72px;
        height: 72px;
    }

    .preview-header h1 {
        font-size: 18px;
    }

    .preview-link {
        font-size: 13px;
        padding: 11px 12px;
        border-radius: 10px;
    }

    /* Card Page */
    .card-container {
        padding: 24px 16px;
        border-radius: 16px;
    }

    .card-avatar {
        width: 90px;
        height: 90px;
        font-size: 30px;
    }

    .card-name {
        font-size: 22px;
    }

    .card-title {
        font-size: 13px;
    }

    .card-link a {
        padding: 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dashboard-section {
        padding: 16px;
    }

    .dashboard-preview {
        position: static !important;
        top: auto !important;
        margin-top: 20px;
    }

    .link-preview {
        flex-direction: column;
        gap: 12px;
    }

    .link-item {
        padding: 12px;
        border-radius: 10px;
    }

    .link-actions {
        flex-direction: row;
        gap: 6px;
    }

    /* Auth Pages */
    .auth-section {
        min-height: calc(100vh - 60px);
        padding: 24px 0;
        align-items: flex-start;
    }

    .auth-inner {
        padding: 24px 20px;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0,0,0,.08);
        margin: 0 auto;
        max-width: 100%;
    }

    .auth-inner h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .auth-inner .btn-primary,
    .auth-inner button[type="submit"] {
        padding: 14px !important;
        font-size: 15px;
        border-radius: 12px;
    }

    /* Alert */
    .alert {
        padding: 12px 14px;
        margin-bottom: 16px;
        font-size: 13px;
        border-radius: 10px;
    }

    .alert ul {
        padding-left: 18px;
    }

    /* Footer */
    .site-footer {
        padding: 24px 0 16px;
        margin-top: 32px;
    }

        .site-footer p {
            font-size: 12px;
            padding: 0 16px;
        }

        /* Modal */
        .modal {
            align-items: flex-end;
            padding: 0;
        }

        .modal-content {
            max-width: 100%;
            border-radius: 20px 20px 0 0;
            padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
            max-height: 90vh;
            overflow-y: auto;
            margin: 0;
            width: 100%;
        }

        .modal-header h2 {
            font-size: 18px;
        }

        .modal-header {
            padding: 0;
            margin-bottom: 16px;
        }

        .modal-close {
            width: 32px;
            height: 32px;
            font-size: 18px;
        }

        .modal-footer {
            flex-direction: column-reverse;
        }

        .modal-footer button,
        .modal-footer a {
            width: 100%;
        }

        /* Panel */
        .panel {
            padding: 18px;
            border-radius: 14px;
        }
}

/* ============ DASHBOARD PREVIEW ============ */
.dashboard-preview {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.card-preview-container {
    margin-top: 16px;
}

.card-preview {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 30px 20px;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.preview-header {
    margin-bottom: 24px;
}

.preview-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-word;
}

.preview-header .job-title {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.preview-header .company {
    font-size: 13px;
    opacity: 0.7;
    margin: 0;
}

.preview-about {
    margin: 0 0 18px;
    padding: 12px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    text-align: right;
}

body.ltr .preview-about {
    text-align: left;
}

.preview-about-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.01em;
    opacity: 0.95;
}

.preview-about-text {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.75;
    opacity: 0.92;
    word-break: break-word;
}

.preview-links {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    cursor: pointer;
}

.preview-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.card-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.card-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102,126,234,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.card-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    box-shadow: 0 10px 30px rgba(102,126,234,0.3);
}

.card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.card-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    word-break: break-word;
}

.card-title {
    font-size: 16px;
    color: var(--gray);
    margin-bottom: 4px;
}

.card-company {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}

.card-links {
    list-style: none;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.card-link {
    margin-bottom: 12px;
    position: relative;
}

.card-link a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    color: white;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.card-link a:hover {
    transform: translateX(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* ============ TABLET (577px - 768px) ============ */
@media (min-width: 577px) and (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .header-inner {
        padding: 14px 0;
    }

    .logo-image {
        height: 40px;
    }

    .logo-text {
        font-size: 18px;
    }

    .nav a {
        padding: 8px 10px;
        font-size: 13px;
    }

    /* Hero */
    .hero {
        padding: 50px 0;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-text h1 {
        font-size: 32px;
    }

    .hero-text p {
        font-size: 16px;
    }

    .card-preview {
        padding: 35px;
        min-height: 360px;
    }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Auth */
    .auth-section {
        padding: 32px 0;
    }

    .auth-inner {
        padding: 32px;
        max-width: 460px;
    }
}

/* ============ MEDIUM SCREENS (769px - 1024px) ============ */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 40px;
    }
}

/* ============ DESKTOP (1025px+) ============ */
@media (min-width: 1025px) {
    .container {
        padding: 0 40px;
    }

    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-text h1 {
        font-size: 48px;
    }
}

/* ================================================================
   LANDING PAGE — NEW DESIGN
   ================================================================ */

/* ---------- HERO ---------- */
.landing-hero {
    position: relative;
    overflow: hidden;
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 50%, #f0e6ff 100%);
}

.landing-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.landing-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .45;
    animation: orbFloat 8s ease-in-out infinite;
}

.landing-orb-1 {
    width: 400px; height: 400px;
    background: #667eea;
    top: -120px; right: -80px;
}

.landing-orb-2 {
    width: 300px; height: 300px;
    background: #f093fb;
    bottom: -100px; left: -60px;
    animation-delay: -3s;
}

.landing-orb-3 {
    width: 200px; height: 200px;
    background: #4facfe;
    top: 50%; left: 50%;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -20px) scale(1.05); }
    66%  { transform: translate(-20px, 15px) scale(.95); }
}

.landing-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Hero text */
.landing-badge {
    display: inline-block;
    background: rgba(102,126,234,.1);
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 100px;
    margin-bottom: 24px;
    border: 1px solid rgba(102,126,234,.18);
}

.landing-hero-text h1 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 20px;
    color: #1a1a2e;
    letter-spacing: -.5px;
}

.landing-hero-text p {
    font-size: 17px;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 520px;
}

.landing-hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

/* Buttons */
.landing-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 8px 30px rgba(102,126,234,.35);
    transition: all .3s ease;
    font-family: 'Cairo','Poppins',sans-serif;
}

.landing-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(102,126,234,.45);
    color: #fff;
}

.landing-btn-primary svg {
    transition: transform .3s;
}

.landing-btn-primary:hover svg {
    transform: translateX(4px);
}

body.rtl .landing-btn-primary:hover svg {
    transform: translateX(-4px);
}

.landing-btn-lg {
    padding: 18px 40px;
    font-size: 18px;
    border-radius: 16px;
}

.landing-btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 16px 28px;
    background: rgba(255,255,255,.7);
    color: #334155;
    font-size: 16px;
    font-weight: 600;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,.08);
    backdrop-filter: blur(8px);
    transition: all .3s ease;
    font-family: 'Cairo','Poppins',sans-serif;
}

.landing-btn-ghost:hover {
    background: #fff;
    border-color: rgba(102,126,234,.3);
    color: #667eea;
}

/* Hero stats */
.landing-hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}

.landing-stat strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
}

.landing-stat span {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.landing-stat-divider {
    width: 1px;
    height: 36px;
    background: #e2e8f0;
}

/* ---------- PHONE MOCKUP ---------- */
.landing-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.landing-phone {
    width: 280px;
    background: #1a1a2e;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 0 30px 80px rgba(26,26,46,.35), 0 0 0 1px rgba(255,255,255,.1) inset;
    position: relative;
    animation: phoneFloat 6s ease-in-out infinite;
}

@keyframes phoneFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

.landing-phone-notch {
    width: 100px;
    height: 28px;
    background: #1a1a2e;
    border-radius: 0 0 16px 16px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.landing-phone-content {
    background: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
    border-radius: 24px;
    padding: 30px 20px 24px;
    text-align: center;
    min-height: 420px;
}

.landing-phone-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(102,126,234,.4);
}

.landing-phone-name {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.landing-phone-title {
    color: rgba(255,255,255,.6);
    font-size: 13px;
    margin-bottom: 22px;
}

.landing-phone-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.landing-phone-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: transform .2s;
}

.landing-phone-link:hover {
    transform: scale(1.03);
}

.landing-phone-link span {
    font-size: 18px;
}

/* Floating emojis */
.landing-float {
    position: absolute;
    font-size: 28px;
    animation: floatBounce 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.15));
}

.landing-float-1 { top: 10%; right: -10px; animation-delay: 0s; }
.landing-float-2 { bottom: 20%; left: -20px; animation-delay: -1.5s; }
.landing-float-3 { top: 45%; right: -30px; animation-delay: -3s; }

@keyframes floatBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(10deg); }
}

/* ---------- SECTION HEADER ---------- */
.landing-section-header {
    text-align: center;
    margin-bottom: 48px;
}

.landing-section-header h2 {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.landing-section-header p {
    font-size: 16px;
    color: #64748b;
}

/* ---------- FEATURES ---------- */
.landing-features {
    padding: 80px 0;
    background: #fff;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.landing-feature-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    padding: 32px 28px;
    transition: all .35s ease;
    position: relative;
    overflow: hidden;
}

.landing-feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    opacity: 0;
    background: linear-gradient(135deg, rgba(102,126,234,.04), rgba(118,75,162,.04));
    transition: opacity .35s;
}

.landing-feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(102,126,234,.12);
    border-color: rgba(102,126,234,.15);
}

.landing-feature-card:hover::after {
    opacity: 1;
}

.landing-feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.landing-feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.landing-feature-card p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* ---------- STEPS ---------- */
.landing-steps {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8faff 0%, #f0e6ff 100%);
}

.landing-steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
}

.landing-step {
    text-align: center;
    flex: 1;
    max-width: 280px;
    padding: 32px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
    transition: all .3s ease;
}

.landing-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(102,126,234,.1);
}

.landing-step-number {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 6px 20px rgba(102,126,234,.3);
}

.landing-step h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.landing-step p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.7;
}

.landing-step-arrow {
    font-size: 28px;
    color: #c7d2fe;
    font-weight: 700;
    margin-top: 60px;
    flex-shrink: 0;
}

body.rtl .landing-step-arrow {
    transform: scaleX(-1);
}

/* ---------- CTA ---------- */
.landing-cta {
    padding: 80px 0;
    background: #fff;
}

.landing-cta-box {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 28px;
    padding: 64px 40px;
    position: relative;
    overflow: hidden;
}

.landing-cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,.12) 0%, transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0%, transparent 60%);
}

.landing-cta-box h2 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
    position: relative;
}

.landing-cta-box p {
    font-size: 17px;
    color: rgba(255,255,255,.8);
    margin-bottom: 32px;
    position: relative;
}

.landing-cta-box .landing-btn-primary {
    background: #fff;
    color: #667eea;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    position: relative;
}

.landing-cta-box .landing-btn-primary:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
    color: #764ba2;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .landing-hero {
        padding: 50px 0 40px;
    }

    .landing-hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .landing-hero-text p {
        max-width: 100%;
    }

    .landing-badge {
        font-size: 12px;
        padding: 6px 14px;
        margin-bottom: 18px;
    }

    .landing-hero-actions {
        justify-content: center;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 28px;
    }

    .landing-btn-primary,
    .landing-btn-ghost {
        width: 100%;
        max-width: 320px;
        justify-content: center;
        padding: 14px 24px;
        font-size: 15px;
    }

    .landing-btn-lg {
        padding: 16px 28px;
        font-size: 16px;
    }

    .landing-hero-stats {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center;
        align-items: center;
        gap: 14px;
    }

    .landing-stat {
        text-align: center;
    }

    .landing-stat strong {
        display: block;
        font-size: 20px;
        font-weight: 800;
    }

    .landing-stat span {
        display: block;
        font-size: 11px;
    }

    .landing-stat-divider {
        height: 28px;
    }

    .landing-phone {
        width: 240px;
        background: #1a1a2e;
        border-radius: 32px;
        padding: 10px;
        box-shadow: 0 20px 60px rgba(26,26,46,.5);
    }

    .landing-phone-content {
        background: linear-gradient(180deg,#16213e 0%,#1a1a2e 100%) !important;
        border-radius: 22px;
        min-height: auto;
        padding: 20px 14px 18px;
    }

    .landing-phone-avatar {
        width: 56px;
        height: 56px;
    }

    .landing-phone-name {
        font-size: 15px;
    }

    .landing-phone-link {
        padding: 10px 12px;
        font-size: 13px;
    }

    .landing-features {
        padding: 50px 0;
    }

    .landing-features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .landing-feature-card {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 16px;
        padding: 18px 16px;
        border-radius: 16px;
        background: #fff;
        border: 1px solid #e8edf5;
        box-shadow: 0 2px 10px rgba(0,0,0,.06);
    }

    .landing-feature-card > div:last-child {
        flex: 1;
        min-width: 0;
    }

    .landing-feature-icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
        font-size: 24px;
        margin-bottom: 0 !important;
        border-radius: 14px;
        flex-shrink: 0;
    }

    .landing-feature-card h3 {
        font-size: 16px;
    }

    .landing-feature-card p {
        font-size: 13px;
    }

    .landing-section-header {
        margin-bottom: 32px;
    }

    .landing-section-header p {
        font-size: 14px;
    }

    .landing-steps {
        padding: 50px 0;
    }

    .landing-steps-grid {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .landing-step {
        padding: 24px 18px;
        max-width: 100%;
    }

    .landing-step-arrow {
        transform: rotate(90deg);
        margin: 0;
        font-size: 22px;
    }

    body.rtl .landing-step-arrow {
        transform: rotate(90deg);
    }

    .landing-cta {
        padding: 50px 0;
    }

    .landing-cta-box {
        padding: 36px 20px;
        border-radius: 20px;
    }

    .landing-cta-box h2 {
        font-size: 22px;
    }

    .landing-cta-box p {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .landing-float { display: none; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .landing-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .landing-hero-inner {
        gap: 40px;
    }

    .landing-phone {
        width: 250px;
    }
}