/* Modern Professional Security Theme for SecureSealer */

:root {
    /* Professional Security Color Palette */
    --primary-dark: #0f3a7d;
    --primary-blue: #1e5fa8;
    --primary-light: #2e7bb9;
    --accent-teal: #00b4d8;
    --accent-cyan: #00d9ff;
    --dark-bg: #0a1428;
    --light-bg: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --secondary-text: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark-bg);
    letter-spacing: -0.5px;
}

p {
    color: var(--gray-700);
}

/* Navigation */
.navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
    background: white !important;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary-blue) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand i {
    color: var(--primary-blue);
}

.navbar-nav .nav-link {
    color: var(--gray-700) !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    margin: 0 8px;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-blue) !important;
}

.navbar-toggler {
    border-color: var(--gray-200);
}

.navbar-toggler:focus {
    box-shadow: none;
    border-color: var(--primary-blue);
}

#profileNav {
    display: flex !important;
    align-items: center;
    gap: 12px;
}

#profileNav.d-none {
    display: none !important;
}

.navbar-user-profile {
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease-out;
}

.navbar-user-profile:hover {
    background: rgba(30, 95, 168, 0.1) !important;
    border-radius: 8px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#publicNavLinks {
    display: flex;
    align-items: center;
    gap: 4px;
}

#publicNavLinks.d-none {
    display: none !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 50%, var(--accent-teal) 100%);
    color: white;
    min-height: 550px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("assets/pattern.svg");
    opacity: 0.5;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
    letter-spacing: -1.5px;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 2rem;
    max-width: 600px;
}

.certificate-graphic {
    animation: float 3s ease-in-out infinite;
}

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

.hero-section .btn {
    font-size: 1.05rem;
    padding: 12px 32px;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: var(--light-bg);
}

.features-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--dark-bg);
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid var(--gray-200);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(30, 95, 168, 0.12);
    border-color: var(--accent-teal);
}

.feature-card i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-card h5 {
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--dark-bg);
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--secondary-text);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Pricing Section */
.pricing-section {
    padding: 80px 0;
}

.pricing-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--dark-bg);
}

.pricing-card {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--gray-200);
    height: 100%;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(30, 95, 168, 0.12);
}

.pricing-card.featured {
    border: 2px solid var(--accent-teal);
    transform: scale(1.05);
    box-shadow: 0 12px 36px rgba(0, 180, 216, 0.15);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.badge-popular {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pricing-card h5 {
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: var(--dark-bg);
}

.price {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 25px 0;
}

.price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--secondary-text);
    display: block;
}

.features-list {
    list-style: none;
    padding: 25px 0;
    text-align: left;
    margin-bottom: 30px;
}

.features-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.95rem;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li i {
    color: var(--success-color);
    margin-right: 12px;
    width: 20px;
    font-weight: 700;
}

.features-list li i.fa-times {
    color: #cbd5e1;
}

/* About Section */
.about-section {
    padding: 80px 0;
    background: var(--light-bg);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px 0 20px;
    margin-top: 80px;
}

footer h6 {
    color: white;
    font-weight: 800;
    margin-bottom: 15px;
    font-size: 1rem;
}

footer p, footer li {
    color: rgba(255, 255, 255, 0.8);
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--accent-teal);
    transform: translateX(4px);
}

footer i {
    color: var(--accent-teal);
    margin-right: 8px;
}

/* Modal Styles */
.modal-content {
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 25px;
    background: var(--light-bg);
}

.modal-header h5 {
    font-weight: 700;
    color: var(--dark-bg);
}

.modal-body {
    padding: 30px;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    padding: 12px 15px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
    background-color: white;
}

.form-label {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    padding: 10px 24px;
}

.btn-sm {
    font-size: 0.875rem;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(30, 95, 168, 0.3);
    color: white;
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    border: none;
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    border: none;
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(30, 95, 168, 0.3);
    color: white;
}

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

.btn-outline-primary {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.btn-outline-danger {
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* Themed Action Button Styles */
.btn-warning {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    border: none;
    color: white;
    font-weight: 600;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 95, 168, 0.3);
    border: none;
}

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

.btn-info {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    border: none;
    color: white;
    font-weight: 600;
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 95, 168, 0.3);
    border: none;
}

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

/* Disabled button styling - maintain theme colors */
.btn:disabled,
.btn-warning:disabled,
.btn-info:disabled,
.btn-secondary:disabled,
.btn-primary:disabled {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    border: none;
    color: white;
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover,
.btn-warning:disabled:hover,
.btn-info:disabled:hover,
.btn-secondary:disabled:hover,
.btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
}

/* Dashboard Styles */
.dashboard-section {
    background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 50%, #ffffff 100%);
    min-height: 100vh;
    padding: 40px 20px 60px;
    transition: all 0.4s ease;
}

@media (min-width: 768px) {
    .dashboard-section {
        padding: 60px 40px;
    }
}

.dashboard-section h2 {
    color: var(--primary-blue);
    margin-bottom: clamp(20px, 5vw, 40px);
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 800;
    animation: slideInDown 0.6s ease-out;
}

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

.dashboard-section .card {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.dashboard-section .card-body {
    padding: clamp(1rem, 5vw, 2rem);
}

/* Responsive table wrapper */
.dashboard-section .table-responsive {
    border-radius: inherit;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Create New Request button responsiveness */
.d-flex.justify-content-between {
    flex-wrap: wrap;
    gap: clamp(0.5rem, 3vw, 1.5rem);
}

.d-flex.justify-content-between h2 {
    flex: 1 1 auto;
    min-width: 200px;
}

.d-flex.justify-content-between .btn {
    flex: 0 1 auto;
    white-space: nowrap;
}

/* Smooth content transitions */
#certificatesTableContainer,
#noCertificatesMessage {
    transition: all 0.3s ease;
}

/* Row animation stagger refinement */
.dashboard-section .table tbody tr {
    will-change: transform, opacity;
}

.dashboard-section .table tbody tr:nth-child(n+5) {
    animation-delay: calc((var(--row-index, 5) - 4) * 0.05s + 0.25s);
}

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

.dashboard-section .table {
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    animation: fadeIn 0.6s ease-out 0.1s both;
    border: 1px solid #dfe8f5;
}

@media (max-width: 1200px) {
    .dashboard-section .table {
        font-size: 0.85rem;
    }
    .dashboard-section .table tbody td {
        padding: 12px 10px;
    }
}

@media (max-width: 992px) {
    .dashboard-section .table {
        font-size: 0.8rem;
    }
    .dashboard-section .table tbody td {
        padding: 10px 8px;
    }
}

.dashboard-section .table thead th {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #1e5fa8 100%);
    border: none;
    font-weight: 700;
    color: white;
    padding: 15px 12px;
    font-size: clamp(0.7rem, 1vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.dashboard-section .table thead th:first-child {
    text-align: left;
}

.dashboard-section .table thead th:last-child {
    text-align: center;
}

.dashboard-section .table tbody td {
    padding: clamp(11px, 2vw, 14px) clamp(10px, 2vw, 12px);
    border-bottom: 1px solid #e8eff7;
    color: var(--gray-800);
    vertical-align: middle;
    text-align: center;
    font-size: clamp(0.75rem, 1vw, 0.85rem);
    background: #f8fcff;
    transition: all 0.25s ease;
}

.dashboard-section .table tbody td:first-child {
    text-align: left;
    font-weight: 700;
    color: var(--primary-blue);
    font-size: clamp(0.8rem, 1.1vw, 0.9rem);
}

.dashboard-section .table tbody td:last-child {
    text-align: center;
}

.dashboard-section .table tbody tr {
    transition: all 0.25s ease;
    animation: slideInUp 0.4s ease-out backwards;
    border-bottom: 1px solid #e8eff7;
}

.dashboard-section .table tbody tr:last-child {
    border-bottom: none;
}

.dashboard-section .table tbody tr:nth-child(odd) td {
    background: #f8fcff;
}

.dashboard-section .table tbody tr:nth-child(even) td {
    background: #f4f9fe;
}

.dashboard-section .table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.dashboard-section .table tbody tr:nth-child(2) { animation-delay: 0.15s; }
.dashboard-section .table tbody tr:nth-child(3) { animation-delay: 0.2s; }
.dashboard-section .table tbody tr:nth-child(n+4) { animation-delay: 0.25s; }

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

.dashboard-section .table tbody tr:hover td {
    background: #dde9f7;
    color: var(--gray-900);
}

.dashboard-section .table tbody tr:hover td:first-child {
    color: var(--primary-blue);
}

.dashboard-section .table tbody tr:hover td {
    color: var(--gray-800);
}

.dashboard-section .table tbody tr:hover td:first-child {
    color: var(--primary-blue);
}

.dashboard-section .table .badge {
    padding: clamp(5px, 1.2vw, 7px) clamp(12px, 2vw, 16px);
    font-size: clamp(0.65rem, 0.9vw, 0.75rem);
    font-weight: 700;
    border-radius: 6px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    transition: all 0.2s ease;
}

.dashboard-section .table .btn {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    padding: clamp(6px, 1.2vw, 8px) clamp(12px, 2vw, 16px);
    transition: all 0.2s ease;
    border-radius: 6px;
}

.dashboard-section .form-control,
.dashboard-section .form-select,
.dashboard-section .form-label {
    border-radius: 8px;
}

.dashboard-section .form-control,
.dashboard-section .form-select {
    border: 1px solid var(--gray-200);
    padding: 12px 15px;
}

.dashboard-section .form-control:focus,
.dashboard-section .form-select:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

/* Alert Messages */
.alert-info {
    background: linear-gradient(135deg, rgba(30, 95, 168, 0.05) 0%, rgba(0, 180, 216, 0.05) 100%);
    border: 1px solid var(--accent-teal);
    border-radius: 8px;
    color: var(--primary-blue);
}

.alert-success {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid var(--success-color);
    border-radius: 8px;
    color: #047857;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    color: #991b1b;
}

/* Badge Styles */
.badge {
    border-radius: 6px;
    font-weight: 700;
    padding: 8px 14px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

.badge.bg-dark {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: white !important;
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card {
    animation: fadeIn 0.6s ease-out forwards;
}

.pricing-card {
    animation: fadeIn 0.6s ease-out forwards;
}

.feature-card:nth-child(2) {
    animation-delay: 0.1s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.2s;
}

.pricing-card:nth-child(2) {
    animation-delay: 0.1s;
}

.pricing-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        min-height: 450px;
        padding: 40px 0;
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }

    .hero-section .lead {
        font-size: 1.1rem;
    }

    .pricing-card.featured {
        transform: scale(1);
        margin-top: 20px;
    }

    .pricing-card.featured:hover {
        transform: scale(1) translateY(-8px);
    }

    .certificate-graphic i {
        font-size: 6rem !important;
    }

    h1, h2, h3 {
        font-size: 1.8rem;
    }
}

/* Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Override Bootstrap SVG select arrow with Font Awesome icon */
.form-select-wrapper {
    position: relative;
    display: block;
}

.form-select-wrapper .form-select {
    background-image: none !important;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    color: var(--gray-600);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Modern CN Validation Indicator */
.cn-validation-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.cn-validation-indicator.valid {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.cn-validation-indicator.invalid {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* CN input with enough padding for indicator */
#commonName {
    padding-right: 120px;
}

/* Disabled state styling for SAN and CN inputs */
#sanInput:disabled {
    background-color: #f8f9fa;
    border-color: #d3d3d3 !important;
    color: #999;
}

#sanInput:disabled::placeholder {
    color: #999;
    opacity: 0.8;
}

#commonName:disabled {
    background-color: #f8f9fa;
    border-color: #d3d3d3 !important;
    color: #999;
}

#commonName:disabled::placeholder {
    color: #999;
    opacity: 0.8;
}

/* Modern Key Size Selector */
.key-size-selector {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.key-size-radio {
    display: none;
}

.key-size-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.key-size-btn:hover {
    border-color: var(--primary-blue);
    background-color: rgba(30, 93, 185, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 93, 185, 0.15);
}

.key-size-icon {
    font-size: 1.5rem;
    color: var(--gray-600);
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-size-text {
    flex: 1;
}

.key-size-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.key-size-desc {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Radio button checked state */
.key-size-radio:checked + .key-size-btn {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(30, 93, 185, 0.08) 0%, rgba(30, 93, 185, 0.04) 100%);
    box-shadow: 0 4px 16px rgba(30, 93, 185, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.5);
}

.key-size-radio:checked + .key-size-btn .key-size-icon {
    color: var(--primary-blue);
    animation: scaleIn 0.3s ease;
}

.key-size-radio:checked + .key-size-btn .key-size-title {
    color: var(--primary-blue);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .key-size-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .key-size-btn {
        padding: 12px 14px;
    }
}

/* Disable browser autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    box-shadow: 0 0 0 30px white inset !important;
}

input:-webkit-autofill {
    -webkit-text-fill-color: inherit !important;
}

/* Certificate form specific autofill prevention */
#certificateForm input:-webkit-autofill,
#certificateForm input:-webkit-autofill:hover,
#certificateForm input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #333 !important;
}

/* Topup Modal - Enhanced Professional Design */
#topupModal .quick-topup-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: #f0f4f8 !important;
    color: var(--primary-blue) !important;
    font-weight: 700 !important;
    border: 1px solid #e0e6ed !important;
    border-radius: 8px !important;
    padding: 0.5rem 0 !important;
    font-size: 0.9rem !important;
}

#topupModal .quick-topup-btn:hover {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2563eb 100%) !important;
    color: white !important;
    border-color: var(--primary-blue) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(30, 95, 168, 0.25) !important;
}

#topupModal .quick-topup-btn:active {
    transform: translateY(0) !important;
}

#topupModal input[type="number"]:focus {
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(30, 95, 168, 0.1) !important;
}

/* Topup Modal Footer Buttons */
#topupModal .modal-footer .btn {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 0.65rem 1.5rem !important;
    transition: all 0.2s ease !important;
}

#topupModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%) !important;
    border: none !important;
    color: white !important;
}

#topupModal .modal-footer .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(30, 95, 168, 0.35) !important;
    transform: translateY(-1px) !important;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%) !important;
}

#topupModal .modal-footer .btn-primary:active {
    transform: translateY(0) !important;
}

#topupModal .modal-footer .btn-secondary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%) !important;
    border: none !important;
    color: white !important;
}

#topupModal .modal-footer .btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(30, 95, 168, 0.35) !important;
    transform: translateY(-1px) !important;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%) !important;
}

#topupModal .modal-footer .btn-light:hover {
    background-color: #f0f4f8 !important;
    border-color: #d0d8e0 !important;
    color: var(--gray-700) !important;
}

#topupModal .modal-footer .btn-primary:disabled,
#topupModal .modal-footer .btn-secondary:disabled {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%) !important;
    opacity: 0.6 !important;
    color: white !important;
    border: none !important;
}
