/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header avec logo */
header {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-text h1 {
    font-size: 32px;
    color: #2c5f7d;
    margin-bottom: 5px;
}

.logo-text .tagline {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
}

/* Main content */
main {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 14px;
}

/* Login Container */
.login-container {
    max-width: 700px;
    margin: 0 auto;
}

.auth-methods h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 22px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 3px solid #ecf0f1;
}

.tab-button {
    flex: 1;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    color: #7f8c8d;
}

.tab-button:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.tab-button.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: #e8f4f8;
}

/* Auth methods */
.auth-method {
    display: none;
}

.auth-method.active {
    display: block;
}

/* Code input */
.code-input {
    text-align: center;
    letter-spacing: 8px;
    font-size: 32px !important;
    font-weight: bold;
}

.help-text {
    text-align: center;
    color: #7f8c8d;
    font-size: 16px;
    margin-top: 15px;
}

/* Bouton partage médecin */
.big-button.doctor-share {
    background: linear-gradient(135deg, #27ae60, #229954);
    margin-top: 15px;
}

.big-button.doctor-share:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    position: relative;
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 28px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Dashboard médecin */
.doctor-dashboard {
    max-width: 1000px;
    margin: 0 auto;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: white;
    margin-bottom: 5px;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.document-card {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.document-card:hover {
    border-color: #3498db;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.document-icon {
    font-size: 48px;
    min-width: 60px;
    text-align: center;
}

.document-info-card {
    flex: 1;
}

.document-info-card h4 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 10px;
}

.document-info-card p {
    margin: 5px 0;
    color: #7f8c8d;
    font-size: 15px;
}

.document-info-card p strong {
    color: #2c3e50;
}

.document-actions {
    min-width: 180px;
}

.document-actions .big-button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
}

.document-info {
    text-align: center;
    margin-bottom: 40px;
}

.document-info svg {
    margin-bottom: 20px;
}

.document-info h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.doc-name {
    font-size: 20px;
    color: #3498db;
    font-weight: 600;
}

/* Auth Box */
.auth-box {
    margin-top: 30px;
}

.info-bubble {
    background: #e8f4f8;
    border-left: 5px solid #3498db;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.info-bubble p {
    margin: 10px 0;
    font-size: 18px;
    color: #2c3e50;
}

.attempts-info {
    font-size: 20px !important;
    color: #e74c3c !important;
    font-weight: bold;
}

/* Form styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.form-group small {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #7f8c8d;
}

.big-input {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    border: 3px solid #bdc3c7;
    border-radius: 10px;
    transition: all 0.3s;
    font-family: monospace;
}

.big-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

/* Buttons */
.big-button {
    width: 100%;
    padding: 20px;
    font-size: 22px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s;
    text-decoration: none;
    color: white;
}

.big-button.primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.big-button.primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
}

.big-button.secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    margin-top: 15px;
}

.big-button.secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #606d75);
    transform: translateY(-2px);
}

.big-button.success {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.big-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-icon {
    font-size: 28px;
}

.small-button {
    padding: 8px 15px;
    font-size: 14px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

.small-button:hover {
    background: #2980b9;
}

/* Messages */
.error-message {
    background: #ffe5e5;
    border-left: 5px solid #e74c3c;
    color: #c0392b;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
}

/* Notice boxes */
.notice-box {
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
}

.notice-box h3 {
    margin-bottom: 15px;
    font-size: 22px;
}

.notice-box p, .notice-box li {
    font-size: 16px;
    line-height: 1.8;
}

.notice-box.info {
    background: #e8f4f8;
    border-left: 5px solid #3498db;
    color: #2c3e50;
}

.notice-box.warning {
    background: #fff3cd;
    border-left: 5px solid #f39c12;
    color: #856404;
}

.notice-box.error {
    background: #ffe5e5;
    border-left: 5px solid #e74c3c;
    color: #c0392b;
}

.notice-box ul {
    margin: 15px 0 10px 25px;
}

.notice-box li {
    margin: 10px 0;
}

.highlight {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 600;
}

/* Help section */
.help-section {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.help-section summary {
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px;
    color: #3498db;
}

.help-section summary:hover {
    color: #2980b9;
}

.help-content {
    padding: 20px 10px;
    font-size: 16px;
}

.help-content p {
    margin: 15px 0;
}

.help-content strong {
    color: #2c3e50;
}

.help-list {
    list-style: none;
    padding: 0;
}

.help-list li {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.help-list strong {
    display: block;
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 5px;
}

/* Viewer */
.viewer-container {
    max-width: 800px;
    margin: 0 auto;
}

.viewer-header {
    margin-bottom: 30px;
    text-align: center;
}

.doc-info h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.security-notice {
    background: #fff3cd;
    padding: 15px;
    border-radius: 10px;
    border-left: 5px solid #f39c12;
    font-size: 16px;
    color: #856404;
}

.pdf-viewer {
    background: #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.pdf-viewer iframe {
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.responsibility-notice {
    margin: 40px 0;
}

/* Error pages */
.error-container {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.error-icon {
    margin-bottom: 30px;
}

.error-container h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 30px;
}

.countdown {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.time-display {
    font-size: 36px;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}

.security-info {
    margin-top: 40px;
    padding: 20px;
    background: #e8f4f8;
    border-radius: 10px;
    font-size: 16px;
    color: #2c3e50;
}

/* Admin page */
.admin-container {
    max-width: 700px;
    margin: 0 auto;
}

.admin-form {
    margin: 30px 0;
}

.copy-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.copy-group input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-family: monospace;
}

.result-box {
    background: #d4edda;
    border-left: 5px solid #28a745;
    padding: 30px;
    border-radius: 10px;
    margin: 30px 0;
}

.result-box h3 {
    color: #155724;
    margin-bottom: 20px;
    font-size: 24px;
}

/* Result tabs */
.result-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid #28a745;
}

.result-tab {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    color: #155724;
}

.result-tab:hover {
    background: #f0f8f0;
}

.result-tab.active {
    background: #d4edda;
    border-bottom-color: #155724;
}

.result-content {
    display: none;
    padding: 20px 0;
}

.result-content.active {
    display: block;
}

.qr-display {
    text-align: center;
}

.qr-display h4 {
    color: #155724;
    margin-bottom: 15px;
}

.link-display, .password-display {
    margin: 20px 0;
}

.link-display label, .password-display label {
    display: block;
    font-weight: 600;
    color: #155724;
    margin-bottom: 10px;
    font-size: 16px;
}

.expiry-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-size: 18px;
}

.files-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
}

.files-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.files-section code {
    display: block;
    background: #2c3e50;
    color: #2ecc71;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
    overflow-x: auto;
}

hr {
    margin: 40px 0;
    border: none;
    border-top: 2px solid #ecf0f1;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    main {
        padding: 20px;
    }

    .logo-text h1 {
        font-size: 24px;
    }

    .big-button {
        font-size: 18px;
        padding: 15px;
    }

    .big-input {
        font-size: 18px;
        padding: 15px;
    }

    .action-buttons {
        flex-direction: column;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    header, footer, .action-buttons, .help-section, .responsibility-notice {
        display: none;
    }

    .viewer-content {
        padding: 0;
    }
}
