.iamsmart-modal{position:fixed;z-index:9999;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.5);display:none;align-items:center;justify-content:center}
.iamsmart-modal-content{background:#fff;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,0.15);width:90%;max-width:400px;overflow:hidden}
.iamsmart-modal-header{background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:#fff;padding:15px 20px;display:flex;justify-content:space-between;align-items:center}
.iamsmart-modal-header h3{margin:0;font-size:18px;font-weight:600}
.iamsmart-close{background:none;border:none;color:#fff;font-size:28px;font-weight:bold;cursor:pointer;padding:0;line-height:1}
.iamsmart-close:hover{opacity:0.8}
.iamsmart-modal-body{padding:30px 20px;text-align:center}
.iamsmart-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px}
.iamsmart-spinner{border:4px solid #f3f3f3;border-top:4px solid #667eea;border-radius:50%;width:50px;height:50px;animation:spin 1s linear infinite;margin-bottom:15px}
@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
.iamsmart-loading p{color:#666;margin:0;font-size:14px}
.iamsmart-qr-image{max-width:250px;max-height:250px;border:1px solid #eee;border-radius:8px;padding:10px}
.iamsmart-error{background:#ffebee;border:1px solid #ef5350;border-radius:4px;padding:15px;margin-top:15px}
.iamsmart-error-message{color:#c62828;margin:0;font-size:14px}
#iamsmart-auth-btn{background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);color:#fff;border:none;padding:12px 24px;border-radius:6px;font-size:14px;font-weight:600;cursor:pointer;transition:all 0.3s}
#iamsmart-auth-btn:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(102,126,234,0.4)}
#iamsmart-waiting p{color:#666;font-size:14px;margin:10px 0 0}


.prefill-dark {
    font-size: 18px;
    background-color: #2b7367;
    border: 1px solid #2b7367;
    border-radius: 1em;
    color: #fff;
    padding: 1em 1em 1em 1em;
    cursor: pointer;
    outline: none;
    border-radius: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Noto Sans SC",Arial,Helvetica,sans-serif;
    margin-bottom: 1em;
    margin-top: 1em;
    background: #2b7367 url(./images/icon-dark.8d5b9325b6483b2f560e.png) no-repeat 11% 50%
}
.prefill-dark:hover {
    background: #fff url(./images/icon-light.91bb059fd990c3109a20.png) no-repeat 11% 50%;
    color: #2b7367;
    border: 1px solid #2b7367
}
.prefill-dark:focus-visible {
    background: #fff url(./images/icon-light.91bb059fd990c3109a20.png) no-repeat 11% 50%;
    color: #2b7367;
    border: 1px solid #2b7367
}
.prefill-dark-en {
    font-size: 18px;
    background-color: #2b7367;
    border: 1px solid #2b7367;
    border-radius: 1em;
    color: #fff;
    padding: 1em 1em 1em 1em;
    cursor: pointer;
    outline: none;
    border-radius: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Noto Sans SC",Arial,Helvetica,sans-serif;
    margin-bottom: 1em;
    margin-top: 1em;
    background: #2b7367 url(./images/icon-dark.8d5b9325b6483b2f560e.png) no-repeat 5% 50%
}
.prefill-dark-en:hover {
    background: #fff url(./images/icon-light.91bb059fd990c3109a20.png) no-repeat 5% 50%;
    color: #2b7367;
    border: 1px solid #2b7367
}
.prefill-dark-en:focus-visible {
    background: #fff url(./images/icon-light.91bb059fd990c3109a20.png) no-repeat 5% 50%;
    color: #2b7367;
    border: 1px solid #2b7367
}
.prefill-buttontext {
    padding-left: 3em;
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
    color:#ffffff;
}
.prefill-dark:focus-visible .prefill-buttontext,
.prefill-dark:hover .prefill-buttontext,
.prefill-dark-en:focus-visible .prefill-buttontext,
.prefill-dark-en:hover .prefill-buttontext{
    color: #2b7367;
}


/* iAM Smart icon for auto-filled fields */
.iamsmart-icon {
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
    cursor: help;
    position: relative;
}

.iamsmart-icon img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.iamsmart-icon:hover::after {
    content: '此資料來自 iAM Smart';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.iamsmart-icon:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
    z-index: 1000;
}

@media(max-width:480px){.iamsmart-modal-content{width:95%;margin:10px}.iamsmart-modal-header{padding:12px 15px}.iamsmart-modal-header h3{font-size:16px}.iamsmart-modal-body{padding:20px 15px}.iamsmart-qr-image{max-width:200px;max-height:200px}}